Blame SOURCES/fix-crash-when-modal-closes-during-drag.patch

f73620
From 33bf5319baec86e6caef5b94c71db8101fb94343 Mon Sep 17 00:00:00 2001
f73620
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
f73620
Date: Fri, 25 May 2018 20:18:23 +0200
f73620
Subject: [PATCH 1/2] window: Don't refuse to move focus to the grab window
f73620
f73620
We refuse to move focus while a grab operation is in place. While this
f73620
generally makes sense, there's no reason why the window that owns the
f73620
grab shouldn't be given the regular input focus as well - we pretty
f73620
much assume that the grab window is also the focus window anyway.
f73620
f73620
In fact there's a strong reason for allowing the focus change here:
f73620
If the grab window isn't the focus window, it probably has a modal
f73620
transient that is focused instead, and a likely reason for the focus
f73620
request is that the transient is being unmanaged and we must move
f73620
the focus elsewhere.
f73620
f73620
https://gitlab.gnome.org/GNOME/mutter/issues/15
f73620
---
f73620
 src/core/window.c | 1 +
f73620
 1 file changed, 1 insertion(+)
f73620
f73620
diff --git a/src/core/window.c b/src/core/window.c
f73620
index 743326c60..5b1eb5b68 100644
f73620
--- a/src/core/window.c
f73620
+++ b/src/core/window.c
f73620
@@ -4620,6 +4620,7 @@ meta_window_focus (MetaWindow  *window,
f73620
               window->desc, window->input, window->take_focus);
f73620
 
f73620
   if (window->display->grab_window &&
f73620
+      window->display->grab_window != window &&
f73620
       window->display->grab_window->all_keys_grabbed &&
f73620
       !window->display->grab_window->unmanaging)
f73620
     {
f73620
-- 
f73620
2.17.1
f73620
f73620
f73620
From 149ae05df628480e8226f035044e6020305a8aeb Mon Sep 17 00:00:00 2001
f73620
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
f73620
Date: Fri, 25 May 2018 21:24:17 +0200
f73620
Subject: [PATCH 2/2] window: Explicitly exclude unmanaging window from focus
f73620
 again
f73620
f73620
Since commit b3b9d9e16 we no longer have to pass the unmanaging window
f73620
to make sure we don't try to focus it again, however the parameter also
f73620
influences the focus policy by giving ancestors preference over the normal
f73620
stack order.
f73620
f73620
https://gitlab.gnome.org/GNOME/mutter/issues/15
f73620
---
f73620
 src/core/window.c | 4 +++-
f73620
 1 file changed, 3 insertions(+), 1 deletion(-)
f73620
f73620
diff --git a/src/core/window.c b/src/core/window.c
f73620
index 5b1eb5b68..cc0813ac4 100644
f73620
--- a/src/core/window.c
f73620
+++ b/src/core/window.c
f73620
@@ -1469,7 +1469,9 @@ meta_window_unmanage (MetaWindow  *window,
f73620
       meta_topic (META_DEBUG_FOCUS,
f73620
                   "Focusing default window since we're unmanaging %s\n",
f73620
                   window->desc);
f73620
-      meta_workspace_focus_default_window (window->screen->active_workspace, NULL, timestamp);
f73620
+      meta_workspace_focus_default_window (window->screen->active_workspace,
f73620
+                                           window,
f73620
+                                           timestamp);
f73620
     }
f73620
   else
f73620
     {
f73620
-- 
f73620
2.17.1
f73620