diff --git a/intellihide.js b/intellihide.js index 4049c76..0970591 100644 --- a/intellihide.js +++ b/intellihide.js @@ -88,7 +88,8 @@ var Intellihide = class { if (Me.settings.get_boolean('intellihide-hide-from-windows')) { this._proximityWatchId = this._proximityManager.createWatch( - this._panelBox.get_parent(), + this._panelBox.get_parent(), + this._dtpPanel.monitor.index, Proximity.Mode[Me.settings.get_string('intellihide-behaviour')], 0, 0, overlap => { diff --git a/proximity.js b/proximity.js index 56cc8bd..ee41380 100644 --- a/proximity.js +++ b/proximity.js @@ -38,8 +38,9 @@ var Mode = { class ProximityWatch { - constructor(actor, mode, xThreshold, yThreshold, handler) { + constructor(actor, monitorIndex, mode, xThreshold, yThreshold, handler) { this.actor = actor; + this.monitorIndex = monitorIndex this.overlap = 0; this.mode = mode; this.threshold = [xThreshold, yThreshold]; @@ -47,18 +48,12 @@ class ProximityWatch { this._allocationChangedId = actor.connect('notify::allocation', () => this._update()); - this._update(); + this._updateWatchRect(); } destroy() { this.actor.disconnect(this._allocationChangedId); } - - _update() { - this.monitorIndex = Main.layoutManager.findIndexForActor(this.actor); - - this._updateWatchRect(); - } _updateWatchRect() { let [actorX, actorY] = this.actor.get_position(); @@ -86,8 +81,8 @@ var ProximityManager = class { this._setFocusedWindow(); } - createWatch(actor, mode, xThreshold, yThreshold, handler) { - let watch = new ProximityWatch(actor, mode, xThreshold, yThreshold, handler); + createWatch(actor, monitorIndex, mode, xThreshold, yThreshold, handler) { + let watch = new ProximityWatch(actor, monitorIndex, mode, xThreshold, yThreshold, handler); this._watches[this._counter] = watch; this.update(); @@ -247,7 +242,8 @@ var ProximityManager = class { this._checkProximity(this._focusedWindowInfo.metaWindow, watch)); } else if (watch.mode === Mode.MAXIMIZED_WINDOWS) { return metaWindows.some(mw => mw.maximized_vertically && mw.maximized_horizontally && - mw.get_monitor() == watch.monitorIndex); + mw.get_monitor() == watch.monitorIndex && + mw.get_workspace() == Utils.getCurrentWorkspace()); } //Mode.ALL_WINDOWS diff --git a/transparency.js b/transparency.js index f2bb8d9..10fac2c 100644 --- a/transparency.js +++ b/transparency.js @@ -138,7 +138,8 @@ var DynamicTransparency = class { let threshold = Me.settings.get_int('trans-dynamic-distance'); this._proximityWatchId = this._proximityManager.createWatch( - this._dtpPanel.panelBox.get_parent(), + this._dtpPanel.panelBox.get_parent(), + this._dtpPanel.monitor.index, Proximity.Mode[Me.settings.get_string('trans-dynamic-behavior')], isVertical ? threshold : 0, isVertical ? 0 : threshold,