From bd8f2c6fee471ee3b460f2a857cae22bca9d41b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20J=C3=B8rgen=20Br=C3=B8nner?= Date: Thu, 19 Oct 2017 14:51:46 +0200 Subject: [PATCH] Keep an explicit "isStacked" flag on metawindows + stackoverlay fixes onCompleted of the tween of the active window didn't always finish before all other windows was done animating (seemingly at least). This caused a wrong overlay position/width since it used `is_scaled` to find the top of the stack. In general it's probably useful to be able to know which windows are stacked before animations are done. Windows might be scaled for other reasons too. Also fixes a bug where the left overlay was active even though the neighbor fully obscured the left stack. (that caused a small region of the left most unstacked window to unresponsive). (due to setting negative width being a noop) --- stackoverlay.js | 5 +++-- tiling.js | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/stackoverlay.js b/stackoverlay.js index 7a5cd26..0579b10 100644 --- a/stackoverlay.js +++ b/stackoverlay.js @@ -64,8 +64,9 @@ var StackOverlay = new Lang.Class({ let panelBox = Main.layoutManager.panelBox; overlay.y = panelBox.height; - overlay.width = stack_margin; + // global.window_group is below the panel so not really necessary to adjust height? overlay.height = this.monitor.height - panelBox.height; + overlay.width = stack_margin; overlay.hide(); @@ -155,7 +156,7 @@ var StackOverlay = new Lang.Class({ overlay.x = 0; overlay.width = Math.min( stack_margin, - neighbourX - resizeBorderWidth + Math.max(0, neighbourX - resizeBorderWidth) ); } else { let neighbour = space[space.indexOf(metaWindow) - 1] diff --git a/tiling.js b/tiling.js index b99f1a5..59b178b 100644 --- a/tiling.js +++ b/tiling.js @@ -120,7 +120,7 @@ focus = () => { } isStacked = function(metaWindow) { - return metaWindow.get_compositor_private().is_scaled(); + return metaWindow._isStacked; } isUnStacked = function(metaWindow) { @@ -158,6 +158,9 @@ move = (meta_window, x, y, onComplete, onStart, delay, transition) => { y += scaled_y_offset; let pivot = actor.pivot_point; actor.set_pivot_point(pivot.x, y_offset/buffer.height); + meta_window._isStacked = true; // use isStacked function to check + } else { + meta_window._isStacked = false; // use isStacked function to check } meta_window.destinationX = x; Tweener.addTween(actor, {x: x - x_offset @@ -363,6 +366,7 @@ ensure_viewport = (space, meta_window, force) => { { x, y, delay, transition, onComplete: () => { space.moving = false; + // NOTE: Stack overlays should really be updated on the early returns above too StackOverlay.leftOverlay.setTarget(space.topOfLeftStack()); StackOverlay.rightOverlay.setTarget(space.topOfRightStack()); // Certain gnome-shell/mutter animations expect default