From 0a9130b6c76bafb553e954feafa197897e6ecbdd Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 12 Jul 2002 00:40:05 +0000 Subject: now we know the state of windows --- util/epist/process.cc | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'util/epist/process.cc') diff --git a/util/epist/process.cc b/util/epist/process.cc index dab1f16d..95588963 100644 --- a/util/epist/process.cc +++ b/util/epist/process.cc @@ -41,10 +41,22 @@ WindowList::iterator _active = _clients.end(); void processEvent(const XEvent &e) { switch (e.type) { case PropertyNotify: - if (e.xproperty.atom == _xatom->getAtom(XAtom::net_active_window)) - updateActiveWindow(); - if (e.xproperty.atom == _xatom->getAtom(XAtom::net_client_list)) - updateClientList(); + if (e.xany.window == _root) { + // root window + if (e.xproperty.atom == _xatom->getAtom(XAtom::net_active_window)) + updateActiveWindow(); + if (e.xproperty.atom == _xatom->getAtom(XAtom::net_client_list)) + updateClientList(); + } else { + // a client window + WindowList::iterator it, end = _clients.end(); + for (it = _clients.begin(); it != end; ++it) + if (*it == e.xproperty.window) + break; + assert(it != end); // this means a client somehow got removed from the + // list! + it->updateState(); + } break; } } -- cgit v1.2.3