From 2757713637fa18ca70ff9dbc55bf8c54c9d46a2c Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Thu, 24 Oct 2013 11:59:30 +0100 Subject: [PATCH] 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. --- src/client.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client.c b/src/client.c index 05b10498..ab977b6c 100644 --- a/src/client.c +++ b/src/client.c @@ -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) -- 2.11.4.GIT