summaryrefslogtreecommitdiff
path: root/src/client.cc
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-12-02 22:36:43 +0000
committerDana Jansens <danakj@orodu.net>2002-12-02 22:36:43 +0000
commit11de5db065830856f79ca0a2021f28080973710d (patch)
treeaff36f164a2fa877268727f30d19e7567ae7c1b9 /src/client.cc
parent7efcff07ea463bd9ae1d374119540fb8dc508489 (diff)
better compression, dont lose events
Diffstat (limited to 'src/client.cc')
-rw-r--r--src/client.cc22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/client.cc b/src/client.cc
index a92c1796..80bab9db 100644
--- a/src/client.cc
+++ b/src/client.cc
@@ -506,7 +506,7 @@ void OBClient::propertyHandler(const XPropertyEvent &e)
// compress changes to a single property into a single change
XEvent ce;
- while (XCheckTypedEvent(otk::OBDisplay::display, e.message_type, &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) {
@@ -671,10 +671,17 @@ void OBClient::clientMessageHandler(const XClientMessageEvent &e)
// compress changes into a single change
bool compress = false;
XEvent ce;
- while (XCheckTypedEvent(otk::OBDisplay::display, e.message_type, &ce))
+ while (XCheckTypedEvent(otk::OBDisplay::display, e.type, &ce)) {
+ // XXX: it would be nice to compress ALL messages of a type, not just
+ // messages in a row without other message types between.
+ if (ce.xclient.message_type != e.message_type) {
+ XPutBackEvent(otk::OBDisplay::display, &ce);
+ break;
+ }
compress = true;
+ }
if (compress)
- setWMState(ce.xclientmessage.data.l[0]); // use the found event
+ setWMState(ce.xclient.data.l[0]); // use the found event
else
setWMState(e.data.l[0]); // use the original event
} else if (e.message_type ==
@@ -682,8 +689,15 @@ void OBClient::clientMessageHandler(const XClientMessageEvent &e)
// compress changes into a single change
bool compress = false;
XEvent ce;
- while (XCheckTypedEvent(otk::OBDisplay::display, e.message_type, &ce))
+ while (XCheckTypedEvent(otk::OBDisplay::display, e.type, &ce)) {
+ // XXX: it would be nice to compress ALL messages of a type, not just
+ // messages in a row without other message types between.
+ if (ce.xclient.message_type != e.message_type) {
+ XPutBackEvent(otk::OBDisplay::display, &ce);
+ break;
+ }
compress = true;
+ }
if (compress)
setDesktop(e.data.l[0]); // use the found event
else