]> Dogcows Code - chaz/openbox/commitdiff
compress property changes a bit
authorDana Jansens <danakj@orodu.net>
Mon, 2 Dec 2002 22:40:33 +0000 (22:40 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 2 Dec 2002 22:40:33 +0000 (22:40 +0000)
src/rootwindow.cc

index 412312574d9f8905ad9119ed37be2c0b7b0708fa..4891b4fe01591b11730e9abceb9764574ba9dddf 100644 (file)
@@ -48,7 +48,18 @@ void OBRootWindow::propertyHandler(const XPropertyEvent &e)
 
   const otk::OBProperty *property = Openbox::instance->property();
 
-  if (e.atom == property->atom(otk::OBProperty::net_desktop_names))
+  // compress changes to a single property into a single change
+  XEvent ce;
+  while (XCheckTypedEvent(otk::OBDisplay::display, e.type, &ce)) {
+    // XXX: it would be nice to compress ALL changes to a property, not just
+    //      changes in a row without other props between.
+    if (ce.xproperty.atom != e.atom) {
+      XPutBackEvent(otk::OBDisplay::display, &ce);
+      break;
+    }
+  }
+
+  if (e.atom == property->atom(otk::OBProperty::net_desktop_names)) 
     updateDesktopNames();
 }
 
This page took 0.022733 seconds and 4 git commands to generate.