core: Move grab_op check for handling window events from passive grabs

This piece of event handling only applies on windows receiving events while
the display is ungrabbed (i.e. for raising it, or beginning a move/resize
operation).

Move the checks on the current grab operation outside of window.c and into
events.c, so all checks about the current grab operation move closer to the
main event handler.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
This commit is contained in:
Carlos Garnacho 2022-09-28 14:03:05 +02:00 committed by Marge Bot
parent a5bd0c39fe
commit a7b8f06196
2 changed files with 3 additions and 4 deletions

View File

@ -470,6 +470,8 @@ meta_display_handle_event (MetaDisplay *display,
*/ */
bypass_clutter = !IS_GESTURE_EVENT (event); bypass_clutter = !IS_GESTURE_EVENT (event);
bypass_wayland = meta_window_has_modals (window); bypass_wayland = meta_window_has_modals (window);
if (display->grab_op == META_GRAB_OP_NONE)
meta_window_handle_ungrabbed_event (window, event); meta_window_handle_ungrabbed_event (window, event);
/* This might start a grab op. If it does, then filter out the /* This might start a grab op. If it does, then filter out the

View File

@ -8295,9 +8295,6 @@ meta_window_handle_ungrabbed_event (MetaWindow *window,
else else
button = clutter_event_get_button (event); button = clutter_event_get_button (event);
if (display->grab_op != META_GRAB_OP_NONE)
return;
/* Some windows might not ask for input, in which case we might be here /* Some windows might not ask for input, in which case we might be here
* because we selected for ButtonPress on the root window. In that case, * because we selected for ButtonPress on the root window. In that case,
* we have to take special care not to act for an override-redirect window. * we have to take special care not to act for an override-redirect window.