From 49d89bcb09c3a24832c1f9508b4f97c6378fd03d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Leporcq?= Date: Sun, 21 Jun 2015 11:57:59 +0200 Subject: [PATCH] Fix #12002 resized window that was previousely maximazed and closed --- src/client.c | 15 --------------- src/placement.c | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/client.c b/src/client.c index 9524211..d076f09 100644 --- a/src/client.c +++ b/src/client.c @@ -1810,21 +1810,6 @@ clientFrame (DisplayInfo *display_info, Window w, gboolean recapture) } /* - Initialize "old" fields once the position is ensured, to avoid - initially maximized or fullscreen windows being placed offscreen - once de-maximized - */ - c->old_x = c->x; - c->old_y = c->y; - c->old_width = c->width; - c->old_height = c->height; - - c->fullscreen_old_x = c->x; - c->fullscreen_old_y = c->y; - c->fullscreen_old_width = c->width; - c->fullscreen_old_height = c->height; - - /* We must call clientApplyInitialState() after having placed the window so that the inital position values are correctly set if the inital state is maximize or fullscreen diff --git a/src/placement.c b/src/placement.c index 7b0ca22..9297f58 100644 --- a/src/placement.c +++ b/src/placement.c @@ -858,6 +858,22 @@ clientInitPosition (Client * c) { clientAutoMaximize (c, full_w, full_h); } + + /* + Initialize "old" fields once the position is ensured, to avoid + initially maximized or fullscreen windows being placed offscreen + once de-maximized + */ + + c->old_x = full_x + (full_w - c->width * 2 / 3) / 2; + c->old_y = full_y + (full_h - c->height * 2 / 3) / 2; + c->old_width = c->width * 2 / 3; + c->old_height = c->height * 2 / 3; + + c->fullscreen_old_x = full_x + (full_w - c->width * 2 / 3) / 2; + c->fullscreen_old_y = full_y + (full_h - c->height * 2 / 3) / 2; + c->fullscreen_old_width = c->width * 2 / 3; + c->fullscreen_old_height = c->height * 2 / 3; } void -- 2.4.3