compositor: 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 17:10:56 -05:00 committed by Marco Trevisan
parent e2bea48073
commit 60170cff70

View File

@ -431,13 +431,11 @@ meta_end_modal_for_plugin (MetaCompositor *compositor,
{
MetaDisplay *display = compositor->display;
MetaBackend *backend = meta_get_backend ();
MetaWindow *grab_window = display->grab_window;
MetaGrabOp grab_op = display->grab_op;
g_return_if_fail (is_modal (display));
g_signal_emit_by_name (display, "grab-op-end",
meta_plugin_get_display (plugin),
display->grab_window, display->grab_op);
display->grab_op = META_GRAB_OP_NONE;
display->event_route = META_EVENT_ROUTE_NORMAL;
display->grab_window = NULL;
@ -454,6 +452,10 @@ meta_end_modal_for_plugin (MetaCompositor *compositor,
meta_display_sync_wayland_input_focus (display);
}
#endif
g_signal_emit_by_name (display, "grab-op-end",
meta_plugin_get_display (plugin),
grab_window, grab_op);
}
static void