]> Dogcows Code - chaz/openbox/commitdiff
don't reparent to root if the client has already reparented since unmapping
authorDana Jansens <danakj@orodu.net>
Tue, 7 Jan 2003 20:21:42 +0000 (20:21 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 7 Jan 2003 20:21:42 +0000 (20:21 +0000)
src/frame.cc

index ac631d01fb68b80fa7dc6a0238b6819678fcb1b0..3b9cb96888bed607bfb871d29b82417ad202ff27 100644 (file)
@@ -429,13 +429,18 @@ void OBFrame::grabClient()
 
 void OBFrame::releaseClient()
 {
-  // XXX: check for a reparent before reparenting?
-  
-  // according to the ICCCM - if the client doesn't reparent to
-  // root, then we have to do it for them
-  XReparentWindow(otk::OBDisplay::display, _client->window(),
-                  _screen->rootWindow(),
-                  _client->area().x(), _client->area().y());
+  // check if the app has already reparented its window away
+  XEvent ev;
+  if (XCheckTypedWindowEvent(otk::OBDisplay::display, _client->window(),
+                             ReparentNotify, &ev)) {
+    XPutBack(otk::OBDisplay::display, &ev);
+  } else {
+    // according to the ICCCM - if the client doesn't reparent itself, then we
+    // will reparent the window to root for them
+    XReparentWindow(otk::OBDisplay::display, _client->window(),
+                    _screen->rootWindow(),
+                    _client->area().x(), _client->area().y());
+  }
 }
 
 
This page took 0.027842 seconds and 4 git commands to generate.