fix condition to restore window position when unmaximized
authorRenan Traba <rvt10@inf.ufpr.br>
Fri, 19 Apr 2013 20:01:15 +0000 (19 17:01 -0300)
committerCarlos R. Mafra <crmafra@gmail.com>
Tue, 21 May 2013 10:24:35 +0000 (21 11:24 +0100)
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

index 17046cf..0808e33 100644 (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;
 }