From f10ec42ba86f3a2c9e1de9f06989509ee89a4770 Mon Sep 17 00:00:00 2001 From: Renan Traba Date: Fri, 19 Apr 2013 17:01:15 -0300 Subject: [PATCH] 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. --- src/actions.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/actions.c b/src/actions.c index 17046cfd..0808e334 100644 --- a/src/actions.c +++ b/src/actions.c @@ -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; } -- 2.11.4.GIT