Peter,

How does the attached experimental patch work for you?

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
>From 570a1401bab45b0177d66cd0e2a779ac5dcfa1dd Mon Sep 17 00:00:00 2001
From: Dominik Vogt <[email protected]>
Date: Tue, 16 Sep 2014 20:34:17 +0100
Subject: [PATCH] !!!experimental fix

---
 fvwm/events.c |   64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)

diff --git a/fvwm/events.c b/fvwm/events.c
index 03dd661..ca5edb6 100644
--- a/fvwm/events.c
+++ b/fvwm/events.c
@@ -284,6 +284,34 @@ Bool test_typed_window_event(
 	return False;
 }
 
+#if 1 /*!!!*/
+Bool invalidate_typed_window_event(
+	Display *display, XEvent *event, XPointer arg)
+{
+	test_typed_window_event_args *ta = (test_typed_window_event_args *)arg;
+#if 1 /*!!!*/
+static int count = 0;
+static int callcount = 0;
+callcount++;
+#endif
+
+	if (event->xany.window == ta->w &&
+	    event->xany.type == ta->event_type &&
+	    event->xproperty.atom == ta->atom)
+	{
+		/* mark the event as invalid */
+		event->xproperty.atom = None;
+#if 1 /*!!!*/
+		count++;
+		if (count % 1000 == 0)
+			fprintf(stderr, "marked %d, called %d\n", count, callcount);
+#endif
+	}
+
+	return False;
+}
+
+#endif
 static Bool test_resizing_event(
 	Display *display, XEvent *event, XPointer arg)
 {
@@ -4279,6 +4307,20 @@ void HandleEvents(void)
 		}
 		if (My_XNextEvent(dpy, &ev))
 		{
+#if 1 /*!!!*/
+			static int count = 0;
+			static int pncount = 0;
+			if (ev.xany.type == PropertyNotify) pncount++;
+			if (pncount % 10000 == 0)
+				fprintf(stderr, "total count %d\n", pncount);
+			if (ev.xany.type == PropertyNotify && ev.xproperty.atom == None)
+			{
+				count++;
+				if (count % 1000 == 0)
+					fprintf(stderr, "skipped %d, total count %d\n", count, pncount);
+				continue;
+			}
+#endif
 			dispatch_event(&ev);
 		}
 		if (Scr.flags.do_need_style_list_update)
@@ -4753,6 +4795,27 @@ int discard_window_events(Window w, long event_mask)
 	return count;
 }
 
+#if 1 /*!!!*/
+/* Similar function for certain types of PropertyNotify. */
+int check_for_another_property_notify(
+	Atom atom, Window w, int *num_events_removed)
+{
+	test_typed_window_event_args args;
+	XEvent e;
+
+	*num_events_removed = 0;
+	XSync(dpy, 0);
+	args.w = w;
+	args.atom = atom;
+	args.event_type = PropertyNotify;
+	/* Get rid of the events. */
+	FCheckPeekIfEvent(
+		dpy, &e, invalidate_typed_window_event, (XPointer)&args);
+
+	return 0;
+}
+
+#else
 /* Similar function for certain types of PropertyNotify. */
 int check_for_another_property_notify(
 	Atom atom, Window w, int *num_events_removed)
@@ -4797,6 +4860,7 @@ int check_for_another_property_notify(
 
 	return pos;
 }
+#endif
 
 /* Wait for all mouse buttons to be released
  * This can ease some confusion on the part of the user sometimes
-- 
1.7.10.4

Reply via email to