summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2023-04-12 10:23:49 +0200
committerCarlos Garnacho <carlosg@gnome.org>2023-04-12 11:28:50 +0200
commitf744acefee25bfb54ceb75e9a21cbcaeb58da40c (patch)
tree2d3cd248c2f309560b98f38ab0d1050a958609b2
parenta42bc34e4d40e73ef0e7b2f9f3b1360cf066acba (diff)
downloadmutter-f744acefee25bfb54ceb75e9a21cbcaeb58da40c.tar.gz
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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2954>
-rw-r--r--src/core/keybindings.c5
1 files changed, 4 insertions, 1 deletions
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)