[mutter/gnome-42] x11/events: Do not handle enter/leave during grabs



commit 2bfd36b9a312afe5bc5c0120aec6f9bbe5318b12
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat May 28 12:09:49 2022 +0200

    x11/events: Do not handle enter/leave during grabs
    
    The COMPOSITOR_GRAB event route has effectively been replaced by
    ClutterGrabs, which are no longer covered by the existing check.
    
    So check for grabs as well to restore the old behavior.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2436>
    (cherry picked from commit d04a1977234e15ef3c5563b94297ba23292360e5)

 src/x11/events.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/x11/events.c b/src/x11/events.c
index 8882baac4e..2c574d5755 100644
--- a/src/x11/events.c
+++ b/src/x11/events.c
@@ -943,6 +943,8 @@ handle_input_xevent (MetaX11Display *x11_display,
   MetaWindow *window;
   MetaDisplay *display = x11_display->display;
   MetaWorkspaceManager *workspace_manager = display->workspace_manager;
+  MetaBackend *backend = meta_get_backend ();
+  ClutterStage *stage = CLUTTER_STAGE (meta_backend_get_stage (backend));
 
   if (input_event == NULL)
     return FALSE;
@@ -973,6 +975,9 @@ handle_input_xevent (MetaX11Display *x11_display,
       if (display->event_route != META_EVENT_ROUTE_NORMAL)
         break;
 
+      if (clutter_stage_get_grab_actor (stage) != NULL)
+        break;
+
       /* Check if we've entered a window; do this even if window->has_focus to
        * avoid races.
        */
@@ -992,6 +997,9 @@ handle_input_xevent (MetaX11Display *x11_display,
       if (display->event_route != META_EVENT_ROUTE_NORMAL)
         break;
 
+      if (clutter_stage_get_grab_actor (stage) != NULL)
+        break;
+
       if (window != NULL &&
           enter_event->mode != XINotifyGrab &&
           enter_event->mode != XINotifyUngrab)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]