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

fix condition to restore window position when unmaximized

if a window was at x=0 or y=0, the original condition return
false and the window is not moved to original position,
but if width or height from old_geometry is set then wmaker
already saved old_geometry, and we can trust x=0 or y=0 is
original position.
This commit is contained in:
Renan Traba
2013-04-19 17:01:15 -03:00
committed by Carlos R. Mafra
parent 5a65dbeb3d
commit f10ec42ba8

View File

@@ -314,8 +314,8 @@ static void remember_geometry(WWindow *wwin, int *x, int *y, int *w, int *h)
old_geom_rect = wmkrect(wwin->old_geometry.x, wwin->old_geometry.y, wwin->old_geometry.width, wwin->old_geometry.height);
old_head = wGetHeadForRect(wwin->screen_ptr, old_geom_rect);
same_head = (wGetHeadForWindow(wwin) == old_head);
*x = (wwin->old_geometry.x && same_head) ? wwin->old_geometry.x : wwin->frame_x;
*y = (wwin->old_geometry.y && same_head) ? wwin->old_geometry.y : wwin->frame_y;
*x = ((wwin->old_geometry.x || wwin->old_geometry.width) && same_head) ? wwin->old_geometry.x : wwin->frame_x;
*y = ((wwin->old_geometry.y || wwin->old_geometry.height) && same_head) ? wwin->old_geometry.y : wwin->frame_y;
*w = wwin->old_geometry.width ? wwin->old_geometry.width : wwin->client.width;
*h = wwin->old_geometry.height ? wwin->old_geometry.height : wwin->client.height;
}