Skip to content

Commit 68acb2a

Browse files
authored
prefer horizontal_margin to minimum_margin (#984)
prefer horizontal_margin for: 1. toggling windows maximize horizontally 2. snapping to left/right edges in swipe gestures fixes #975.
2 parents 00f9173 + 5a9f414 commit 68acb2a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tiling.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4305,10 +4305,10 @@ export function ensuredX(meta_window, space) {
43054305
} else if (frame.width > workArea.width * 0.9 - 2 * (Settings.prefs.horizontal_margin + Settings.prefs.window_gap)) {
43064306
// Consider the window to be wide and center it
43074307
x = min + Math.round((workArea.width - frame.width) / 2);
4308-
} else if (x + frame.width > max) {
4308+
} else if (x + Settings.prefs.horizontal_margin + frame.width > max) {
43094309
// Align to the right prefs.horizontal_margin
43104310
x = max - Settings.prefs.horizontal_margin - frame.width;
4311-
} else if (x < min) {
4311+
} else if (x < min + Settings.prefs.horizontal_margin) {
43124312
// Align to the left prefs.horizontal_margin
43134313
x = min + Settings.prefs.horizontal_margin;
43144314
} else if (x + frame.width === max) {
@@ -4789,7 +4789,7 @@ export function toggleMaximizeHorizontally(metaWindow) {
47894789
let space = spaces.spaceOfWindow(metaWindow);
47904790
let workArea = space.workArea();
47914791
let frame = metaWindow.get_frame_rect();
4792-
let reqWidth = maxWidthPrc * workArea.width - Settings.prefs.minimum_margin * 2;
4792+
let reqWidth = maxWidthPrc * workArea.width - Settings.prefs.horizontal_margin * 2;
47934793

47944794
// Some windows only resize in increments > 1px so we can't rely on a precise width
47954795
// Hopefully this heuristic is good enough
@@ -4803,7 +4803,7 @@ export function toggleMaximizeHorizontally(metaWindow) {
48034803

48044804
metaWindow.unmaximizedRect = null;
48054805
} else {
4806-
let x = workArea.x + space.monitor.x + Settings.prefs.minimum_margin;
4806+
let x = workArea.x + space.monitor.x + Settings.prefs.horizontal_margin;
48074807
metaWindow.unmaximizedRect = frame;
48084808
metaWindow.move_resize_frame(true, x, frame.y, reqWidth, frame.height);
48094809
}

0 commit comments

Comments
 (0)