summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-12-02 22:19:07 +0000
committerDana Jansens <danakj@orodu.net>2002-12-02 22:19:07 +0000
commit786834abea24b8ebc233d894e6ffd40a38da0170 (patch)
tree7b9fbce71a1955d02fca73ce455607c91efbc723 /src
parentdca0c9f5a308e115ec308cdc8ca7987ff4fc0479 (diff)
compress property changes into a single change
Diffstat (limited to 'src')
-rw-r--r--src/client.cc28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/client.cc b/src/client.cc
index 34fcf6fa..7dd63b2a 100644
--- a/src/client.cc
+++ b/src/client.cc
@@ -656,12 +656,30 @@ void OBClient::clientMessageHandler(const XClientMessageEvent &e)
const otk::OBProperty *property = Openbox::instance->property();
- if (e.message_type == property->atom(otk::OBProperty::wm_change_state))
- setWMState(e.data.l[0]);
- else if (e.message_type ==
- property->atom(otk::OBProperty::net_wm_desktop))
- setDesktop(e.data.l[0]);
+ if (e.message_type == property->atom(otk::OBProperty::wm_change_state)) {
+ // compress changes into a single change
+ bool compress = false;
+ XEvent ce;
+ while (XCheckTypedEvent(otk::OBDisplay::display, e.message_type, &ce))
+ compress = true;
+ if (compress)
+ setWMState(ce.xclientmessage.data.l[0]); // use the found event
+ else
+ setWMState(e.data.l[0]); // use the original event
+ } else if (e.message_type ==
+ property->atom(otk::OBProperty::net_wm_desktop)) {
+ // compress changes into a single change
+ bool compress = false;
+ XEvent ce;
+ while (XCheckTypedEvent(otk::OBDisplay::display, e.message_type, &ce))
+ compress = true;
+ if (compress)
+ setDesktop(e.data.l[0]); // use the found event
+ else
+ setDesktop(e.data.l[0]); // use the original event
+ }
else if (e.message_type == property->atom(otk::OBProperty::net_wm_state))
+ // can't compress these
setState((StateAction)e.data.l[0], e.data.l[1], e.data.l[2]);
}