mirror of
https://github.com/gosticks/PaperWM.git
synced 2026-10-04 19:46:53 +00:00
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.
This commit is contained in:
+5
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user