Skip to content

Commit 988a618

Browse files
committed
fix: Fix a delay of the window hint on display movements
1 parent 5f619b3 commit 988a618

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/window.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,9 @@ export class ShellWindow {
443443
break;
444444
}
445445

446-
GLib.timeout_add(GLib.PRIORITY_LOW, restackSpeed, () => {
446+
const action = () => {
447+
if (!this.actor_exists) return
448+
447449
let border = this.border;
448450
let actor = this.meta.get_compositor_private();
449451
let win_group = global.window_group;
@@ -481,7 +483,9 @@ export class ShellWindow {
481483
}
482484

483485
return false; // make sure it runs once
484-
});
486+
}
487+
488+
GLib.timeout_add(GLib.PRIORITY_LOW, restackSpeed, action)
485489
}
486490

487491
get always_top_windows(): Clutter.Actor[] {
@@ -546,10 +550,8 @@ export class ShellWindow {
546550
if (dimensions) {
547551
[x, y, width, height] = dimensions
548552

549-
const screen = global
550-
.workspace_manager
551-
.get_active_workspace()
552-
.get_work_area_for_monitor(global.display.get_current_monitor())
553+
const screen = this.meta.get_workspace()
554+
.get_work_area_for_monitor(this.meta.get_monitor())
553555

554556
if (screen) {
555557
x = Math.max(x, screen.x)

0 commit comments

Comments
 (0)