From e2bea4807313b556aa774e22fb0585a8403ff52a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Mon, 27 May 2019 16:07:48 -0500 Subject: [PATCH] display: Emit 'grab-op-end' signal after ungrab happened We're currently emitting the 'grab-op-end' signal when the grab prerequisites are met, but when display->grab_op is still set to a not-NONE value and thus meta_display_get_grab_op() would return that in the signal callback. And more importantly when this is emitted, devices are still grabbed. Instead, emit this signal as soon as we've unset all the grab properties and released the devices. Helps with https://gitlab.gnome.org/GNOME/gnome-shell/issues/1326 https://gitlab.gnome.org/GNOME/mutter/merge_requests/596 --- src/core/display.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/display.c b/src/core/display.c index ae5bc2caf..704ec1662 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -1837,9 +1837,6 @@ meta_display_end_grab_op (MetaDisplay *display, g_assert (grab_window != NULL); - g_signal_emit (display, display_signals[GRAB_OP_END], 0, - display, grab_window, grab_op); - /* We need to reset this early, since the * meta_window_grab_op_ended callback relies on this being * up to date. */ @@ -1891,6 +1888,9 @@ meta_display_end_grab_op (MetaDisplay *display, if (meta_is_wayland_compositor ()) meta_display_sync_wayland_input_focus (display); + + g_signal_emit (display, display_signals[GRAB_OP_END], 0, + display, grab_window, grab_op); } /**