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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3661>
This commit is contained in:
Sebastian Keller 2024-03-13 23:04:47 +01:00 committed by Marge Bot
parent 1cfc1aa92b
commit a1381ea6bc

View File

@ -539,14 +539,14 @@ meta_cursor_tracker_set_pointer_visible (MetaCursorTracker *tracker,
sync_cursor (tracker); sync_cursor (tracker);
g_signal_emit (tracker, signals[VISIBILITY_CHANGED], 0);
seat = clutter_backend_get_default_seat (clutter_get_default_backend ()); seat = clutter_backend_get_default_seat (clutter_get_default_backend ());
if (priv->is_showing) if (priv->is_showing)
clutter_seat_inhibit_unfocus (seat); clutter_seat_inhibit_unfocus (seat);
else else
clutter_seat_uninhibit_unfocus (seat); clutter_seat_uninhibit_unfocus (seat);
g_signal_emit (tracker, signals[VISIBILITY_CHANGED], 0);
} }
MetaBackend * MetaBackend *