Here's the patch. I've done some initial testing and nothing seems to have broken but it's probably worth keeping a close eye on things.
>From c622257d35e1fb3138b98b9a668deb7b50f51b5c Mon Sep 17 00:00:00 2001
From: Iain Patterson <[email protected]>
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 05b1049..ab977b6 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)
-- 
1.8.3.1

Reply via email to