_layer = Layer_Normal;
// default to not urgent
_urgent = false;
+ // not positioned unless specified
+ _positioned = false;
getArea();
getDesktop();
}
+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;
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;
{
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) {
//! Remove focus from the client window
void unfocus() const;
+ //! Validate client, by making sure no Destroy or Unmap events exist in
+ //! the event queue for the window.
+ /*!
+ @return true if the client is valid; false if the client has already
+ been unmapped/destroyed, and so is invalid.
+ */
+ bool validate() const;
+
virtual void focusHandler(const XFocusChangeEvent &e);
virtual void unfocusHandler(const XFocusChangeEvent &e);
virtual void propertyHandler(const XPropertyEvent &e);