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
This commit is contained in:
Marco Trevisan (Treviño) 2019-05-27 16:07:48 -05:00 committed by Marco Trevisan
parent bbfaf8204b
commit e2bea48073

View File

@ -1837,9 +1837,6 @@ meta_display_end_grab_op (MetaDisplay *display,
g_assert (grab_window != NULL); 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 /* We need to reset this early, since the
* meta_window_grab_op_ended callback relies on this being * meta_window_grab_op_ended callback relies on this being
* up to date. */ * up to date. */
@ -1891,6 +1888,9 @@ meta_display_end_grab_op (MetaDisplay *display,
if (meta_is_wayland_compositor ()) if (meta_is_wayland_compositor ())
meta_display_sync_wayland_input_focus (display); meta_display_sync_wayland_input_focus (display);
g_signal_emit (display, display_signals[GRAB_OP_END], 0,
display, grab_window, grab_op);
} }
/** /**