On Wed, January 20, 2016 00:00, Raimund Steger wrote:
> [...]
> Now after a couple of weeks filled with countless FVWM restarts, I've
> finally looked into building a patch (attached) that will at least update
> $[vp.width] and make FVWM popup menus be clipped correctly to the changed
> screen area. As far as I've been able to tell this seems to work, although
> I have no real grasp about what places *would* actually need to be changed
> to do it properly. Also, what I've done is very likely totally wrong for
> multi-head/Xinerama setups.

er, I just noticed that the patch hard-coded my desktop size. I think I've
improved it now.



-- 
Worringer Str 31 Duesseldorf 40211 DE  home: <r...@mytum.de>
+49-179-2981632 icq 16845346           work: <r...@interface-ag.de>
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-20 13:17:54.646131958 +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-20 13:17:54.646131958 +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-20 14:33:54.579624466 +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,26 @@
 }
 #endif /* HAVE_STROKE */
 
+void HandleConfigureNotify(const evh_args_t *ea)
+{
+	int n,m;
+	const XEvent *te = ea->exc->x.etrigger;
+
+	DBUG("HandleConfigureNotify", "Routine Entered");
+
+	if (te->xconfigure.window == Scr.Root)
+	{
+		n = Scr.VxMax / Scr.MyDisplayWidth;
+		m = Scr.VyMax / Scr.MyDisplayHeight;
+		Scr.MyDisplayWidth = te->xconfigure.width;
+		Scr.MyDisplayHeight = te->xconfigure.height;
+		Scr.VxMax = n*Scr.MyDisplayWidth;
+		Scr.VyMax = m*Scr.MyDisplayHeight;
+		EWMH_UpdateWorkArea();
+		FScreenUpdateGeometry (te->xconfigure.width, te->xconfigure.height);
+	}
+}
+
 void HandlePropertyNotify(const evh_args_t *ea)
 {
 	Bool OnThisPage = False;
@@ -4028,6 +4049,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-20 13:17:54.648131994 +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-20 13:17:54.649132012 +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 */

Reply via email to