diff options
| author | Dana Jansens <danakj@orodu.net> | 2002-07-12 00:40:05 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2002-07-12 00:40:05 +0000 |
| commit | 0a9130b6c76bafb553e954feafa197897e6ecbdd (patch) | |
| tree | c1bef7740c3f90665aedddfdb0e83a044494970d /util/epist/process.cc | |
| parent | cf3d512a998151bd585906c7478b576d5d3877ff (diff) | |
now we know the state of windows
Diffstat (limited to 'util/epist/process.cc')
| -rw-r--r-- | util/epist/process.cc | 20 |
1 files changed, 16 insertions, 4 deletions
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; } } |
