This patch aims to provide support for ConfigureNotify events on the FVWM
root window, in that all structures that store the window's extents are
updated. This does not work well with Xinerama (only updates global screen),
and I've no idea whether the updates in Scr are not really disastrous in
a Xinerama-enabled configuration. I'll have to check some more.

diff -ru fvwm-2.6.5/fvwm/eventhandler.h fvwm-2.6.5.new/fvwm/eventhandler.h
--- fvwm-2.6.5/fvwm/eventhandler.h	2004-09-03 05:02:17.000000000 +0200
+++ fvwm-2.6.5.new/fvwm/eventhandler.h	2016-01-19 13:37:32.135674252 +0100
@@ -43,6 +43,7 @@
 void HandleConfigureRequest(const evh_args_t *ea);
 void HandleClientMessage(const evh_args_t *ea);
 void HandlePropertyNotify(const evh_args_t *ea);
+void HandleConfigureNotify(const evh_args_t *ea);
 void HandleKeyPress(const evh_args_t *ea);
 void HandleKeyRelease(const evh_args_t *ea);
 void HandleVisibilityNotify(const evh_args_t *ea);
diff -ru fvwm-2.6.5/fvwm/eventmask.h fvwm-2.6.5.new/fvwm/eventmask.h
--- fvwm-2.6.5/fvwm/eventmask.h	2003-06-29 21:53:23.000000000 +0200
+++ fvwm-2.6.5.new/fvwm/eventmask.h	2016-01-19 13:49:22.193884081 +0100
@@ -56,6 +56,7 @@
 	(LeaveWindowMask| EnterWindowMask | \
 	PropertyChangeMask | SubstructureRedirectMask | KeyPressMask | \
 	KeyReleaseMask | \
+	StructureNotifyMask | \
 	SubstructureNotifyMask | ColormapChangeMask | \
 	STROKE_CODE(ButtonMotionMask | DEFAULT_ALL_BUTTONS_MOTION_MASK |) \
 	ButtonPressMask | ButtonReleaseMask)
diff -ru fvwm-2.6.5/fvwm/events.c fvwm-2.6.5.new/fvwm/events.c
--- fvwm-2.6.5/fvwm/events.c	2012-04-20 12:41:05.000000000 +0200
+++ fvwm-2.6.5.new/fvwm/events.c	2016-01-19 17:24:22.735429486 +0100
@@ -62,6 +62,7 @@
 #include "libs/Parse.h"
 #include "libs/ColorUtils.h"
 #include "libs/FShape.h"
+#include "libs/FScreen.h"
 #include "libs/PictureBase.h"
 #include "libs/Colorset.h"
 #include "libs/charmap.h"
@@ -3208,6 +3209,23 @@
 }
 #endif /* HAVE_STROKE */
 
+void HandleConfigureNotify(const evh_args_t *ea)
+{
+	const XEvent *te = ea->exc->x.etrigger;
+
+	DBUG("HandleConfigureNotify", "Routine Entered");
+	
+	if (te->xconfigure.window == Scr.Root)
+	{
+	    Scr.MyDisplayWidth = te->xconfigure.width;
+	    Scr.MyDisplayHeight = te->xconfigure.height;
+	    Scr.VxMax = 2*Scr.MyDisplayWidth;
+	    Scr.VyMax = 2*Scr.MyDisplayHeight;
+	    EWMH_UpdateWorkArea();
+	    FScreenUpdateGeometry(te->xconfigure.width,te->xconfigure.height);
+	}
+}
+
 void HandlePropertyNotify(const evh_args_t *ea)
 {
 	Bool OnThisPage = False;
@@ -4028,6 +4046,7 @@
 	EventHandlerJumpTable[FocusOut] =         HandleFocusOut;
 	EventHandlerJumpTable[ConfigureRequest] = HandleConfigureRequest;
 	EventHandlerJumpTable[ClientMessage] =    HandleClientMessage;
+	EventHandlerJumpTable[ConfigureNotify] =  HandleConfigureNotify;
 	EventHandlerJumpTable[PropertyNotify] =   HandlePropertyNotify;
 	EventHandlerJumpTable[KeyPress] =         HandleKeyPress;
 	EventHandlerJumpTable[KeyRelease] =       HandleKeyRelease;
diff -ru fvwm-2.6.5/libs/FScreen.c fvwm-2.6.5.new/libs/FScreen.c
--- fvwm-2.6.5/libs/FScreen.c	2011-09-30 11:00:53.000000000 +0200
+++ fvwm-2.6.5.new/libs/FScreen.c	2016-01-19 17:44:39.411734829 +0100
@@ -1512,6 +1512,12 @@
 }
 
 
+void FScreenUpdateGeometry(int new_w,int new_h)
+{
+	screens[0].width  = new_w;
+	screens[0].height = new_h;
+}
+
 /* no rand_r for now */
 # if 0
 int  FScreenGetRandrEventType(void)
diff -ru fvwm-2.6.5/libs/FScreen.h fvwm-2.6.5.new/libs/FScreen.h
--- fvwm-2.6.5/libs/FScreen.h	2011-09-30 11:00:53.000000000 +0200
+++ fvwm-2.6.5.new/libs/FScreen.h	2016-01-19 17:22:14.757262720 +0100
@@ -97,4 +97,6 @@
 Bool FScreenHandleRandrEvent(
 	XEvent *event, int *old_w, int *old_h, int *new_w, int *new_h);
 
+void FScreenUpdateGeometry(int new_w,int new_h);
+
 #endif /* FVWMLIB_FSCRREN_H */
