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
(cherry-picked from b087752b55
)
This commit is contained in:
parent
4c7b20e584
commit
09fbb4a127
@ -1763,6 +1763,14 @@ var WindowManager = new Lang.Class({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
switchData.inGroup.set_position(-xDest, -yDest);
|
switchData.inGroup.set_position(-xDest, -yDest);
|
||||||
switchData.inGroup.raise_top();
|
switchData.inGroup.raise_top();
|
||||||
|
|
||||||
@ -1793,8 +1801,8 @@ var WindowManager = new Lang.Class({
|
|||||||
|
|
||||||
for (let i = 0; i < switchData.windows.length; i++) {
|
for (let i = 0; i < switchData.windows.length; i++) {
|
||||||
let w = switchData.windows[i];
|
let w = switchData.windows[i];
|
||||||
if (w.window.is_destroyed()) // Window gone
|
w.window.disconnect(w.windowDestroyId);
|
||||||
continue;
|
|
||||||
if (w.window.get_parent() == switchData.outGroup) {
|
if (w.window.get_parent() == switchData.outGroup) {
|
||||||
w.window.reparent(w.parent);
|
w.window.reparent(w.parent);
|
||||||
w.window.hide();
|
w.window.hide();
|
||||||
|
Loading…
Reference in New Issue
Block a user