1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 04:48:06 +01:00

Avoid unnecessary wWindowConfigure().

If a window handles a ConfigureRequest which did not specify a move or
resize operation we should not call wWindowConfigure() and save the
window geometry.

Sergey Popov reported a scenario in which the old behaviour caused a bug:

* Start gvim with a server.
  "gvim --servername qwe .gimvrc"

* Maximize gvim.

* (Re)open a file in the same window
  "gvim --servername qwe --remote-silent .gvimrc"

* Now the window claims to be unmaximized and its old geometry is
  forgotten.

The bug was that when the gvim window reread the file it generated a
ConfigureRequest without specifying a geometry change but we called
wWindowConfigure() and saved its geometry as though it had been
maximized.
This commit is contained in:
Iain Patterson
2013-10-24 11:59:30 +01:00
committed by Carlos R. Mafra
parent e650bf49ea
commit 2757713637

View File

@@ -235,6 +235,10 @@ void wClientConfigure(WWindow * wwin, XConfigureRequestEvent * xcre)
else
nheight = wwin->frame->core->height - wwin->frame->top_width - wwin->frame->bottom_width;
/* Don't overwrite the saved geometry unnecessarily. */
if (!(xcre->value_mask & (CWX | CWY | CWWidth | CWHeight)))
return;
if (nwidth != wwin->old_geometry.width)
wwin->flags.maximized &= ~(MAX_HORIZONTAL | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS);
if (nheight != wwin->old_geometry.height)