From a1381ea6bce22550059dc7fa6a9d48c0180eeebe Mon Sep 17 00:00:00 2001 From: Sebastian Keller Date: Wed, 13 Mar 2024 23:04:47 +0100 Subject: [PATCH] cursor-tracker: Move `visibility-changed` signal emission to the end The gnome-shell magnifier listens to the `visibility-changed` signal and calls meta_cursor_tracker_set_pointer_visible(false) when the cursor became visible. This leads to a reentrance in meta_cursor_tracker_set_pointer_visible() and clutter_seat_uninhibit_unfocus() gets called twice, once from the meta_cursor_tracker_set_pointer_visible(false) by the magnifier and then the original meta_cursor_tracker_set_pointer_visible(true) continues, after the first call has set is_showing to false again. This breaks the inhibitor counting and the ability to use the cursor while using the magnifier. Part-of: --- src/backends/meta-cursor-tracker.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backends/meta-cursor-tracker.c b/src/backends/meta-cursor-tracker.c index 605a86190..f804e5f73 100644 --- a/src/backends/meta-cursor-tracker.c +++ b/src/backends/meta-cursor-tracker.c @@ -539,14 +539,14 @@ meta_cursor_tracker_set_pointer_visible (MetaCursorTracker *tracker, sync_cursor (tracker); - g_signal_emit (tracker, signals[VISIBILITY_CHANGED], 0); - seat = clutter_backend_get_default_seat (clutter_get_default_backend ()); if (priv->is_showing) clutter_seat_inhibit_unfocus (seat); else clutter_seat_uninhibit_unfocus (seat); + + g_signal_emit (tracker, signals[VISIBILITY_CHANGED], 0); } MetaBackend *