Proposed patch to solve the issue.
the problem apparently comes from the initialization of variables that define the size of the previous resized windows.
Thanks for your tests and comments about this patch.
Patch 6320, "Fix resizing window that was previously maximized and closed": Fix-12002.patch
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
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
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
The attached patch attempts to set a default window size for windows created in a maximized state. Some programs like geany doesn't set the size correctly, as a result, the windows stays full size when it is unmaximized. Another problem is with LibreOffice Calc, when opening a .csv file in a maximized state, Calc sets it's window size to 1x1 pixels which obviously cause troubles. patch-0003.diff