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

Function resizeHDec

tiling.js:4852–4871  ·  view source on GitHub ↗
(metaWindow)

Source from the content-addressed store, hash-verified

4850}
4851
4852export function resizeHDec(metaWindow) {
4853 metaWindow = metaWindow || display.focus_window;
4854 let frame = metaWindow.get_frame_rect();
4855 let space = spaces.spaceOfWindow(metaWindow);
4856 let workArea = space.workArea();
4857
4858 let maxHeight = workArea.height - Settings.prefs.horizontal_margin * 2 - Settings.prefs.window_gap;
4859 let step = Math.floor(maxHeight * 0.1);
4860 let currentHeight = Math.round(frame.height / step) * step;
4861 let minHeight = step;
4862 let targetHeight = Math.max(currentHeight - step, minHeight);
4863 let targetY = frame.y;
4864
4865 if (isMaximized(metaWindow)) {
4866 unmaximize(metaWindow, Meta.MaximizeFlags.BOTH);
4867 }
4868
4869 // Space.layout will ensure the window is moved if necessary
4870 metaWindow.move_resize_frame(true, frame.x, targetY, frame.width, targetHeight);
4871}
4872
4873export function resizeWInc(metaWindow) {
4874 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