From 6b77d06d72bbe3ba06e3f67a99aff6eee57fa823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Tue, 12 Feb 2019 09:11:03 +0100 Subject: [PATCH] edgeoverlays: bound by monitor's workarea --- stackoverlay.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/stackoverlay.js b/stackoverlay.js index b817615..adf2971 100644 --- a/stackoverlay.js +++ b/stackoverlay.js @@ -277,6 +277,7 @@ var StackOverlay = new Lang.Class({ // Assume the resize edge is at least this big (empirically found..) const minResizeEdge = 8; + let workArea = Main.layoutManager.getWorkAreaForMonitor(this.monitor.index); if (this._direction === Meta.MotionDirection.LEFT) { let column = space[space.indexOf(metaWindow) + 1]; @@ -284,10 +285,10 @@ var StackOverlay = new Lang.Class({ if (!neighbour) return bail(); // Should normally have a neighbour. Bail! - let width = neighbour.clone.targetX + space.targetX - minResizeEdge; + let width = neighbour.clone.targetX + space.targetX - minResizeEdge - workArea.x; if (space.isPlaceable(metaWindow)) width = Math.min(width, 1); - overlay.x = this.monitor.x; + overlay.x = workArea.x; overlay.width = Math.max(width, 1); } else { let column = space[space.indexOf(metaWindow) - 1]; @@ -297,11 +298,11 @@ var StackOverlay = new Lang.Class({ let frame = neighbour.get_frame_rect(); frame.x = neighbour.clone.targetX + space.targetX; - let width = this.monitor.width - (frame.x + frame.width) - minResizeEdge; + let width = workArea.x + workArea.width - (frame.x + frame.width) - minResizeEdge; if (space.isPlaceable(metaWindow)) width = 1; width = Math.max(width, 1); - overlay.x = this.monitor.x + this.monitor.width - width; + overlay.x = workArea.x + workArea.width - width; overlay.width = width; }