summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-01-29 08:59:13 +0000
committerDana Jansens <danakj@orodu.net>2003-01-29 08:59:13 +0000
commit6c5c7fd04b2f9aca24b4ff7ee1db86064dcc63ef (patch)
tree43731d5122473c1deff842d8c95440a3f51f1e48
parent39c6969de2714904dec901c9d3f4e8b0ff01f062 (diff)
don't manage override_redirect windows.
don't manage windows for whome get attributes fails. validate the client before managing it.
-rw-r--r--src/screen.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/screen.cc b/src/screen.cc
index b0c071a9..e2bab5c8 100644
--- a/src/screen.cc
+++ b/src/screen.cc
@@ -433,16 +433,34 @@ void Screen::manageWindow(Window window)
Client *client = 0;
XWMHints *wmhint;
XSetWindowAttributes attrib_set;
+ XEvent e;
+ XWindowAttributes attrib;
otk::display->grab();
+ // 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
+ }
+
// is the window a docking app
if ((wmhint = XGetWMHints(**otk::display, window))) {
if ((wmhint->flags & StateHint) &&
wmhint->initial_state == WithdrawnState) {
//slit->addClient(w); // XXX: make dock apps work!
- otk::display->ungrab();
+ otk::display->ungrab();
XFree(wmhint);
return;
}