From 525ed1166c498ea031c0819d3532c85ad5926343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Fri, 1 Mar 2024 16:41:46 +0100 Subject: [PATCH] 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: --- src/backends/meta-cursor-tracker.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/backends/meta-cursor-tracker.c b/src/backends/meta-cursor-tracker.c index bc8adcee5..605a86190 100644 --- a/src/backends/meta-cursor-tracker.c +++ b/src/backends/meta-cursor-tracker.c @@ -109,9 +109,11 @@ update_displayed_cursor (MetaCursorTracker *tracker) { MetaCursorTrackerPrivate *priv = 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; - if (priv->has_window_cursor) + if (display && !meta_display_is_grabbed (display) && priv->has_window_cursor) cursor = priv->window_cursor; else cursor = priv->root_cursor;