From 7856ed36fc5a71af880c94f9e141d687c98e11f8 Mon Sep 17 00:00:00 2001 From: Jonian Guveli Date: Sun, 30 Aug 2020 12:29:17 +0300 Subject: [PATCH] window manager: check for windows on display 'window-entered-monitor' fix #173 --- unite@hardpixel.eu/window.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/unite@hardpixel.eu/window.js b/unite@hardpixel.eu/window.js index 48109b8..01d83ea 100644 --- a/unite@hardpixel.eu/window.js +++ b/unite@hardpixel.eu/window.js @@ -331,6 +331,10 @@ var WindowManager = GObject.registerClass( global.window_manager, 'destroy', this._onDestroyWindow.bind(this) ) + this.signals.connect( + global.display, 'window-entered-monitor', this._onWindowEntered.bind(this) + ) + this.signals.connect( global.display, 'notify::focus-window', this._onFocusWindow.bind(this) ) @@ -405,6 +409,12 @@ var WindowManager = GObject.registerClass( } } + _onWindowEntered(display, index, meta_window) { + if (isValid(meta_window)) { + this.setWindow(meta_window) + } + } + _onFocusWindow(display) { if (this.focusWindow) { this.focusWindow.syncComponents()