From d24be90941cb3d7335c9ed8e476198bf1c5e2b81 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 28 Aug 2023 16:06:51 +0200 Subject: [PATCH] backends/native: Fix accounting of cursor overlay inhibition We react on changes to has_hw_cursor, but always try to inhibit if there is no cursor sprite. While this looks like a reasonable optimization with the typical situation of one cursor renderer, it may fall into inhibiting twice without knowing to unwind, e.g.: 1. has_hw_cursor: TRUE, cursor_sprite: !=NULL -> inhibit 2. has_hw_cursor: FALSE, cursor_sprite: NULL -> inhibit 3. has_hw_cursor: TRUE, cursor_sprite: !=NULL -> uninhibit, but once And this may also result in the CLUTTER_PAINT_FLAG_NO_CURSORS flag staying on for Tablet cursors, that (so far) always use overlay paths. This results in invisible tablet cursors after using the mouse at least once. Fixes: e52641c4b68 ("cursor-renderer/native: Replace HW cursor with KMS cursor manager") Part-of: --- src/backends/native/meta-cursor-renderer-native.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backends/native/meta-cursor-renderer-native.c b/src/backends/native/meta-cursor-renderer-native.c index 7aa549350..c7c2ce2a7 100644 --- a/src/backends/native/meta-cursor-renderer-native.c +++ b/src/backends/native/meta-cursor-renderer-native.c @@ -368,7 +368,7 @@ meta_cursor_renderer_native_update_cursor (MetaCursorRenderer *cursor_renderer, if (cursor_stage_view->has_hw_cursor != has_hw_cursor) { - if (has_hw_cursor || !cursor_sprite) + if (has_hw_cursor) meta_stage_view_inhibit_cursor_overlay (view); else meta_stage_view_uninhibit_cursor_overlay (view);