+ // check if it has already been unmapped by the time we started mapping
+ // the grab does a sync so we don't have to here
+ if (XCheckTypedWindowEvent(**otk::display, window, DestroyNotify, &e) ||
+ XCheckTypedWindowEvent(**otk::display, window, UnmapNotify, &e)) {
+ XPutBackEvent(**otk::display, &e);
+
+ otk::display->ungrab();
+ return; // don't manage it
+ }
+
+ if (!XGetWindowAttributes(**otk::display, window, &attrib) ||
+ attrib.override_redirect) {
+ otk::display->ungrab();
+ return; // don't manage it
+ }
+