compress property events a bit, thanks dana!
authorMikael Magnusson <mikachu@comhem.se>
Mon, 4 Jun 2007 21:54:22 +0000 (21:54 +0000)
committerMikael Magnusson <mikachu@comhem.se>
Mon, 4 Jun 2007 21:54:22 +0000 (21:54 +0000)
rspanel.c

index 8e98e39..00b171d 100644 (file)
--- a/rspanel.c
+++ b/rspanel.c
@@ -753,6 +753,12 @@ static void handle_focusin(Window win)
 }
 #endif
 
+static Bool look_for_duplicate_property(Display *d, XEvent *e, XPointer arg)
+{
+    Atom at = *(Atom*)arg;
+    return (e->type == PropertyNotify && e->xproperty.atom == at);
+}
+
 static void handle_propertynotify(Window win, Atom at)
 {
     task *tk;
@@ -763,6 +769,8 @@ static void handle_propertynotify(Window win, Atom at)
         if (at == atoms[_NET_CLIENT_LIST] || at == atoms[_NET_CURRENT_DESKTOP]
             || at == atoms[_NET_ACTIVE_WINDOW])
         {
+            XEvent ce;
+            while (XCheckIfEvent(dd, &ce, look_for_duplicate_property, (XPointer)&at));
             taskbar_read_clientlist();
             gui_draw_taskbar();
         }