mirror of
https://github.com/gosticks/PaperWM.git
synced 2026-08-12 12:10:27 +00:00
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)
This commit is contained in:
+3
-2
@@ -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]
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user