mirror of
https://github.com/gosticks/PaperWM.git
synced 2026-08-16 14:10:28 +00:00
fixup! cycleWindowWidth: Remember and prefer the originial position
This commit is contained in:
@@ -2583,6 +2583,10 @@ function toggleMaximizeHorizontally(metaWindow) {
|
||||
function cycleWindowWidth(metaWindow, space, {context} = {}) {
|
||||
let steps = prefs.cycle_width_steps;
|
||||
|
||||
// Remember the original position
|
||||
if (context.targetX === undefined)
|
||||
context.targetX = space.targetX;
|
||||
|
||||
let frame = metaWindow.get_frame_rect();
|
||||
let monitor = Main.layoutManager.monitors[metaWindow.get_monitor()];
|
||||
let workArea = space.workArea();
|
||||
@@ -2605,7 +2609,6 @@ function cycleWindowWidth(metaWindow, space, {context} = {}) {
|
||||
targetX = workArea.x + workArea.width - minimumMargin() - targetWidth;
|
||||
}
|
||||
} else {
|
||||
context.targetX = context.targetX || space.targetX;
|
||||
if (space.targetX + space.cloneContainer.width === space.width) {
|
||||
space.targetX -= targetWidth - frame.width;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user