From f744acefee25bfb54ceb75e9a21cbcaeb58da40c Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 12 Apr 2023 10:23:49 +0200 Subject: [PATCH] core: Create passive button grab on topmost Window With the frames client, we do no longer handle events for the frame window inside Mutter. This means we do not get events "for free" to handle focus on a just clicked frame window. This results in a background window not ending up focused if clicked on its frame. In order to fix this, make the passive button grab extend to the frame window if a window has one. This brings back focus-on-click behavior, while treating windows further as a unitary surface. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2727 Part-of: --- src/core/keybindings.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/keybindings.c b/src/core/keybindings.c index d08e9619b..63c7315ce 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -1205,7 +1205,10 @@ meta_change_button_grab (MetaKeyBindingManager *keys, meta_clutter_x11_trap_x_errors (); - xwindow = window->xwindow; + if (window->frame) + xwindow = window->frame->xwindow; + else + xwindow = window->xwindow; /* GrabModeSync means freeze until XAllowEvents */ if (grab)