]> Dogcows Code - chaz/openbox/blobdiff - src/screen.cc
don't manage override_redirect windows.
[chaz/openbox] / src / screen.cc
index 51a6f76ea60ee7c573b9d8526947e7fa9ffe4813..e2bab5c8efa48796b3071cb03a9f0cfa56f16bcd 100644 (file)
@@ -224,7 +224,7 @@ void Screen::updateStrut()
 
 void Screen::calcArea()
 {
-  otk::Rect old_area = _area;
+//  otk::Rect old_area = _area;
 
 /*
 #ifdef    XINERAMA
@@ -261,7 +261,7 @@ void Screen::calcArea()
 #endif // XINERAMA
 */
   
-  if (old_area != _area)
+  //if (old_area != _area)
     // XXX: re-maximize windows
 
   changeWorkArea();
@@ -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;
     }
This page took 0.024711 seconds and 4 git commands to generate.