diff --git a/tiling.js b/tiling.js index 0536d39..4f66b05 100644 --- a/tiling.js +++ b/tiling.js @@ -593,8 +593,10 @@ class Space extends Array { if (!w.get_compositor_private()) return; - if (this.isPlaceable(w)) - this.visible.push(w); + if (!this.isPlaceable(w)) + return; + + this.visible.push(w); // Guard against races between move_to and layout // eg. moving can kill ongoing resize on wayland @@ -611,20 +613,18 @@ class Space extends Array { let y = monitor.y + Math.round(clone.y); let f = w.get_frame_rect(); (f.x !== x || f.y !== y) && w.move_frame(true, x, y); - }); - this.visible.forEach(w => { let actor = w.get_compositor_private(); // The actor's width/height is not correct right after resize let b = w.get_buffer_rect(); - const x = Math.max(0, monitor.x - b.x); - const y = Math.max(0, monitor.y - b.y); - const cw = b.width - x + const cx = Math.max(0, monitor.x - b.x); + const cy = Math.max(0, monitor.y - b.y); + const cw = b.width - cx - Math.max(0, (b.x + b.width) - (monitor.x + monitor.width)); - const ch = actor.height - y + const ch = actor.height - cy - Math.max(0, (b.y + b.height) - (monitor.y + monitor.height)); - actor.set_clip(x, y, cw, ch); + actor.set_clip(cx, cy, cw, ch); w.clone.hide(); actor.show();