X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fclient.cc;h=3939b0c61ada1b63278e7d0691ccf392da3cf722;hb=3e889e72f500cf523edf2b8e51964a8af63c70e1;hp=572c383aecb15d5f2410164c834f877f0349454e;hpb=3f784100ab51dce9e33652a9dd867140dd04a4aa;p=chaz%2Fopenbox diff --git a/src/client.cc b/src/client.cc index 572c383a..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) { @@ -1343,6 +1366,7 @@ bool Client::focus() XSendEvent(**otk::display, _window, False, NoEventMask, &ce); } + XSync(**otk::display, False); return true; }