]> Dogcows Code - chaz/openbox/blobdiff - src/Screen.cc
epist + multihead == <drool>
[chaz/openbox] / src / Screen.cc
index 6970fdf68111095befb48096e916cf5eadeafc67..eee7db1085692b2e9fd7b2f458ca85cb5ae33d73 100644 (file)
@@ -1257,6 +1257,15 @@ void BScreen::manageWindow(Window w) {
 void BScreen::unmanageWindow(BlackboxWindow *w, bool remap) {
   w->restore(remap);
 
+  // Remove the modality so that its parent won't try to re-focus the window
+  if (w->isModal()) w->setModal(False);
+  
+  if (w->getWorkspaceNumber() != BSENTINEL &&
+      w->getWindowNumber() != BSENTINEL)
+    getWorkspace(w->getWorkspaceNumber())->removeWindow(w);
+  else if (w->isIconic())
+    removeIcon(w);
+
   if (w->isNormal()) {
     // we don't list non-normal windows as managed windows
     windowList.remove(w);
@@ -1272,6 +1281,9 @@ void BScreen::unmanageWindow(BlackboxWindow *w, bool remap) {
     assert(it != end);  // the window wasnt a desktop window?
   }
 
+  if (blackbox->getFocusedWindow() == w)
+    blackbox->setFocusedWindow((BlackboxWindow *) 0);
+
   removeNetizen(w->getClientWindow());
 
   /*
This page took 0.022058 seconds and 4 git commands to generate.