From a7b8f061963e756c2838c836e78cb0c60d1e111b Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 28 Sep 2022 14:03:05 +0200 Subject: [PATCH] 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: --- src/core/events.c | 4 +++- src/core/window.c | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/events.c b/src/core/events.c index 8bc122c6a..8b3c31641 100644 --- a/src/core/events.c +++ b/src/core/events.c @@ -470,7 +470,9 @@ meta_display_handle_event (MetaDisplay *display, */ bypass_clutter = !IS_GESTURE_EVENT (event); bypass_wayland = meta_window_has_modals (window); - meta_window_handle_ungrabbed_event (window, event); + + if (display->grab_op == META_GRAB_OP_NONE) + meta_window_handle_ungrabbed_event (window, event); /* This might start a grab op. If it does, then filter out the * event, and if it doesn't, replay the event to release our diff --git a/src/core/window.c b/src/core/window.c index 88ae93a9f..76a6c1a9b 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -8295,9 +8295,6 @@ meta_window_handle_ungrabbed_event (MetaWindow *window, else 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 * 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.