wayland/pointer: Unset current surface during window drags

Commit d48129f5ee broke the displaying of our own drag cursor during window
drags, as now the window cursor is always used, even during stage grabs
(window grabs are just a kind of stage grab).

To fix it, while not regressing on the intention of the other commit, unset
the MetaWaylandPointer surface in case a window drag is active (instead of
all kinds of grabs) by checking via meta_display_is_grab().

Fixes: d48129f5ee ("wayland: Fix pointer cursor during Wayland grabs")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3316
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3624>
This commit is contained in:
Jonas Dreßler 2024-03-01 16:41:46 +01:00
parent 8519a31e8f
commit 525ed1166c

View File

@ -109,9 +109,11 @@ update_displayed_cursor (MetaCursorTracker *tracker)
{ {
MetaCursorTrackerPrivate *priv = MetaCursorTrackerPrivate *priv =
meta_cursor_tracker_get_instance_private (tracker); meta_cursor_tracker_get_instance_private (tracker);
MetaContext *context = meta_backend_get_context (priv->backend);
MetaDisplay *display = meta_context_get_display (context);
MetaCursorSprite *cursor = NULL; MetaCursorSprite *cursor = NULL;
if (priv->has_window_cursor) if (display && !meta_display_is_grabbed (display) && priv->has_window_cursor)
cursor = priv->window_cursor; cursor = priv->window_cursor;
else else
cursor = priv->root_cursor; cursor = priv->root_cursor;