diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-01-29 08:58:28 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-01-29 08:58:28 +0000 |
| commit | 39c6969de2714904dec901c9d3f4e8b0ff01f062 (patch) | |
| tree | 7c3f301b30f2e8ae49fe9269b22ffc2b433150af /src/client.cc | |
| parent | 58dc93abb91452444b932f3b2d9bbcc8003891b0 (diff) | |
allow for the client to be validated.
don't manage override_redirect windows.
don't manage windows for whome get attributes fails.
validate the client before managing it.
validate the client in functions that query stuff off it: propertyHandler and clientMessageHandler
Diffstat (limited to 'src/client.cc')
| -rw-r--r-- | src/client.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/client.cc b/src/client.cc index 77906e80..3939b0c6 100644 --- a/src/client.cc +++ b/src/client.cc @@ -49,6 +49,8 @@ Client::Client(int screen, Window window) _layer = Layer_Normal; // default to not urgent _urgent = false; + // not positioned unless specified + _positioned = false; getArea(); getDesktop(); @@ -115,6 +117,21 @@ Client::~Client() } +bool Client::validate() const +{ + XSync(**otk::display, false); // get all events on the server + + XEvent e; + if (XCheckTypedWindowEvent(**otk::display, _window, DestroyNotify, &e) || + XCheckTypedWindowEvent(**otk::display, _window, UnmapNotify, &e)) { + XPutBackEvent(**otk::display, &e); + return false; + } + + return true; +} + + void Client::getGravity() { XWindowAttributes wattrib; @@ -636,6 +653,9 @@ void Client::updateTransientFor() void Client::propertyHandler(const XPropertyEvent &e) { otk::EventHandler::propertyHandler(e); + + // validate cuz we query stuff off the client here + if (!validate()) return; // compress changes to a single property into a single change XEvent ce; @@ -910,6 +930,9 @@ void Client::clientMessageHandler(const XClientMessageEvent &e) { otk::EventHandler::clientMessageHandler(e); + // validate cuz we query stuff off the client here + if (!validate()) return; + if (e.format != 32) return; if (e.message_type == otk::Property::atoms.wm_change_state) { |
