window: Don't refuse to move focus to the grab window
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 25 May 2018 18:18:23 +0000 (18:18 +0000)
committerSimon McVittie <smcv@debian.org>
Tue, 31 Jul 2018 14:35:03 +0000 (15:35 +0100)
We refuse to move focus while a grab operation is in place. While this
generally makes sense, there's no reason why the window that owns the
grab shouldn't be given the regular input focus as well - we pretty
much assume that the grab window is also the focus window anyway.

In fact there's a strong reason for allowing the focus change here:
If the grab window isn't the focus window, it probably has a modal
transient that is focused instead, and a likely reason for the focus
request is that the transient is being unmanaged and we must move
the focus elsewhere.

https://gitlab.gnome.org/GNOME/mutter/issues/15

(cherry picked from commit 148da24f9510ebd23d750b8224aa0ab3a549e69e)

Bug-GNOME: https://gitlab.gnome.org/GNOME/mutter/issues/15
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1422253
Applied-Upstream: 3.28.4, commit:https://gitlab.gnome.org/GNOME/mutter/commit/513cc535

Gbp-Pq: Name window-Don-t-refuse-to-move-focus-to-the-grab-window.patch

src/core/window.c

index 743326c60e19cc02af2f4f6d4f44859d637cd57d..5b1eb5b6873f4d422e163ceb54bdb670176bfc79 100644 (file)
@@ -4620,6 +4620,7 @@ meta_window_focus (MetaWindow  *window,
               window->desc, window->input, window->take_focus);
 
   if (window->display->grab_window &&
+      window->display->grab_window != window &&
       window->display->grab_window->all_keys_grabbed &&
       !window->display->grab_window->unmanaging)
     {