+
+
+void XWindow::processEvent(const XEvent &e) {
+ assert(e.xany.window == _window);
+
+ switch (e.type) {
+ case PropertyNotify:
+ // a client window
+ if (e.xproperty.atom == _xatom->getAtom(XAtom::net_wm_state))
+ updateState();
+ else if (e.xproperty.atom == _xatom->getAtom(XAtom::net_wm_desktop))
+ updateDesktop();
+ else if (e.xproperty.atom == _xatom->getAtom(XAtom::net_wm_name) ||
+ e.xproperty.atom == _xatom->getAtom(XAtom::wm_name))
+ updateTitle();
+ else if (e.xproperty.atom == _xatom->getAtom(XAtom::wm_class))
+ updateClass();
+ break;
+ case DestroyNotify:
+ case UnmapNotify:
+ _unmapped = true;
+ break;
+ }
+}
+
+
+void XWindow::shade(const bool sh) const {
+ _xatom->sendClientMessage(_screen->rootWindow(), XAtom::net_wm_state,
+ _window, (sh ? 1 : 0), XAtom::net_wm_state_shaded);
+}