From 19dd7b7ea2c25300de382bb914e9042dbf6f06da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20J=C3=B8rgen=20Br=C3=B8nner?= Date: Sun, 20 Jan 2019 14:58:45 +0100 Subject: [PATCH] Prevent clicks from reaching non-placable windows (X11) When window_gap is largish it was possible to click on the non-placable metawindow (between the stackoverlay and the neigbour window) - triggering #80. L: left non-placable (clone) R: right non-placable (clone) G: gap/2 A/B: placable window LGGAA..BBBGGR Allocate `LGG - "guaranteed-resize-edge-width"` to the stackoverlay to ensure it's impossible to click on the non-placable window below. Ideally we'd only allocate L or maybe LG to the overlay. Note: We could add special logic for wayland since #80 only affects X11. --- stackoverlay.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/stackoverlay.js b/stackoverlay.js index a16aabb..efa130e 100644 --- a/stackoverlay.js +++ b/stackoverlay.js @@ -248,13 +248,16 @@ var StackOverlay = new Lang.Class({ overlay.y = this.monitor.y + Main.layoutManager.panelBox.height + prefs.vertical_margin; + // Assume the resize edge is at least this big (empirically found..) + const minResizeEdge = 8; + if (this._direction === Meta.MotionDirection.LEFT) { let column = space[space.indexOf(metaWindow) + 1]; let neighbour = column && column[0]; if (!neighbour) return bail(); // Should normally have a neighbour. Bail! - let width = neighbour.clone.targetX + space.targetX - prefs.window_gap; + let width = neighbour.clone.targetX + space.targetX - minResizeEdge; if (space.isPlaceable(metaWindow)) width = Math.min(width, 1); overlay.x = this.monitor.x; @@ -267,7 +270,7 @@ 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) - prefs.window_gap; + let width = this.monitor.width - (frame.x + frame.width) - minResizeEdge; if (space.isPlaceable(metaWindow)) width = 1; width = Math.max(width, 1);