Skip to content

Commit feaf0e3

Browse files
authored
fix: avoid activating a window that was/is being destroyed (#1573)
1 parent 16eaeb5 commit feaf0e3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/window.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export class ShellWindow {
127127
}
128128

129129
actor_exists(): boolean {
130-
return this.meta.get_compositor_private() !== null;
130+
return this.meta.get_compositor_private() !== null || this.destroying;
131131
}
132132

133133
private bind_window_events() {
@@ -663,6 +663,13 @@ export class ShellWindow {
663663
/// Activates a window, and moves the mouse point.
664664
export function activate(ext: Ext, move_mouse: boolean, win: Meta.Window) {
665665
try {
666+
// Return if window was destroyed.
667+
if (!win.get_compositor_private()) return
668+
669+
// Return if window is being destroyed.
670+
if (ext.get_window(win)?.destroying) return
671+
672+
// Return if window has override-redirect set.
666673
if (win.is_override_redirect()) return
667674

668675
const workspace = win.get_workspace()

0 commit comments

Comments
 (0)