1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +01:00

autoPlaceWindow: try placing window at center first

This commit is contained in:
Yuri Karaban
2014-04-12 18:55:57 +03:00
committed by Carlos R. Mafra
parent 78be868972
commit ccd96d1563

View File

@@ -434,6 +434,14 @@ autoPlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
sw = usableArea.x2 - usableArea.x1;
sh = usableArea.y2 - usableArea.y1;
/* try placing at center first */
if (center_place_window(wwin, &x, &y, width, height, usableArea) &&
screen_has_space(scr, x, y, width, height, False)) {
*x_ret = x;
*y_ret = y;
return True;
}
/* this was based on fvwm2's smart placement */
for (y = Y_ORIGIN; (y + height) < sh; y += PLACETEST_VSTEP) {
for (x = X_ORIGIN; (x + width) < sw; x += PLACETEST_HSTEP) {