MCPcopy
hub / github.com/paperwm/PaperWM / resizeHInc

Function resizeHInc

tiling.js:4832–4850  ·  view source on GitHub ↗
(metaWindow)

Source from the content-addressed store, hash-verified

4830}
4831
4832export function resizeHInc(metaWindow) {
4833 metaWindow = metaWindow || display.focus_window;
4834 let frame = metaWindow.get_frame_rect();
4835 let space = spaces.spaceOfWindow(metaWindow);
4836 let workArea = space.workArea();
4837
4838 let maxHeight = workArea.height - Settings.prefs.horizontal_margin * 2 - Settings.prefs.window_gap;
4839 let step = Math.floor(maxHeight * 0.1);
4840 let currentHeight = Math.round(frame.height / step) * step;
4841 let targetHeight = Math.min(currentHeight + step, maxHeight);
4842 let targetY = frame.y;
4843
4844 if (isMaximized(metaWindow)) {
4845 unmaximize(metaWindow, Meta.MaximizeFlags.BOTH);
4846 }
4847
4848 // Space.layout will ensure the window is moved if necessary
4849 metaWindow.move_resize_frame(true, frame.x, targetY, frame.width, targetHeight);
4850}
4851
4852export function resizeHDec(metaWindow) {
4853 metaWindow = metaWindow || display.focus_window;

Callers

nothing calls this directly

Calls 4

isMaximizedFunction · 0.85
unmaximizeFunction · 0.85
spaceOfWindowMethod · 0.80
workAreaMethod · 0.80

Tested by

no test coverage detected