gnome-shell/0001-windowManager-listen-actively-to-windows-being-destr.patch
Adam Williamson e8345c8283 Replace dnd fix with upstream version, backport some other fixes
The dnd fix in -5 was actually redundant, a similar fix for the
same bug had already been committed upstream. Replace it with
the upstream version, plus three other fixes from the same MR.
Also add several other fixes from post-3.30.0 git master which
look important and useful.
2018-09-19 11:41:10 -07:00

47 lines
1.5 KiB
Diff

From b087752b5539a8cbb1d61979cb069aef8a3475be Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Thu, 6 Sep 2018 21:50:21 +0200
Subject: [PATCH] windowManager: listen actively to windows being destroyed
during WS switch
Prevents gjs from dealing with already dispose()d objects.
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/539
---
js/ui/windowManager.js | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index b6627e253..2295e3010 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -1910,6 +1910,14 @@ var WindowManager = new Lang.Class({
actor.visible = visible;
}
}
+
+ for (let i = 0; i < switchData.windows.length; i++) {
+ let w = switchData.windows[i];
+
+ w.windowDestroyId = w.window.connect('destroy', () => {
+ switchData.windows.splice(switchData.windows.indexOf(w), 1);
+ });
+ }
},
_finishWorkspaceSwitch(switchData) {
@@ -1917,9 +1925,8 @@ var WindowManager = new Lang.Class({
for (let i = 0; i < switchData.windows.length; i++) {
let w = switchData.windows[i];
- if (w.window.is_destroyed()) // Window gone
- continue;
+ w.window.disconnect(w.windowDestroyId);
w.window.reparent(w.parent);
if (w.window.get_meta_window().get_workspace() !=
--
2.19.0