compress property changes into a single change
This commit is contained in:
parent
dca0c9f5a3
commit
786834abea
1 changed files with 23 additions and 5 deletions
|
@ -656,12 +656,30 @@ void OBClient::clientMessageHandler(const XClientMessageEvent &e)
|
||||||
|
|
||||||
const otk::OBProperty *property = Openbox::instance->property();
|
const otk::OBProperty *property = Openbox::instance->property();
|
||||||
|
|
||||||
if (e.message_type == property->atom(otk::OBProperty::wm_change_state))
|
if (e.message_type == property->atom(otk::OBProperty::wm_change_state)) {
|
||||||
setWMState(e.data.l[0]);
|
// compress changes into a single change
|
||||||
else if (e.message_type ==
|
bool compress = false;
|
||||||
property->atom(otk::OBProperty::net_wm_desktop))
|
XEvent ce;
|
||||||
setDesktop(e.data.l[0]);
|
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))
|
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]);
|
setState((StateAction)e.data.l[0], e.data.l[1], e.data.l[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue