mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
autoPlaceWindow: try placing window at center first
This commit is contained in:
committed by
Carlos R. Mafra
parent
78be868972
commit
ccd96d1563
@@ -434,6 +434,14 @@ autoPlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
|
|||||||
sw = usableArea.x2 - usableArea.x1;
|
sw = usableArea.x2 - usableArea.x1;
|
||||||
sh = usableArea.y2 - usableArea.y1;
|
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 */
|
/* this was based on fvwm2's smart placement */
|
||||||
for (y = Y_ORIGIN; (y + height) < sh; y += PLACETEST_VSTEP) {
|
for (y = Y_ORIGIN; (y + height) < sh; y += PLACETEST_VSTEP) {
|
||||||
for (x = X_ORIGIN; (x + width) < sw; x += PLACETEST_HSTEP) {
|
for (x = X_ORIGIN; (x + width) < sw; x += PLACETEST_HSTEP) {
|
||||||
|
|||||||
Reference in New Issue
Block a user