]> Dogcows Code - chaz/openbox/blobdiff - src/Workspace.cc
use the True/False as is the blackbox code standard.
[chaz/openbox] / src / Workspace.cc
index 309ea950f156b9c0e8945c6ff36a3ff750c6881e..90a83b2678a43a531dd78f214b668b2fb1055299 100644 (file)
@@ -103,8 +103,13 @@ unsigned int Workspace::removeWindow(BlackboxWindow *w) {
   if ((w->isFocused() || w == lastfocus) &&
       ! screen->getBlackbox()->doShutdown()) {
     BlackboxWindow *newfocus = 0;
-    if (w->isTransient())
+    if (w->isTransient()) {
       newfocus = w->getTransientFor();
+      if (newfocus &&
+          (newfocus->isIconic() ||                // do not focus icons
+           newfocus->getWorkspaceNumber() != id)) // or other workspaces
+        newfocus = 0;
+    }
     if (! newfocus && ! stackingList.empty())
       newfocus = stackingList.front();
 
@@ -115,7 +120,7 @@ unsigned int Workspace::removeWindow(BlackboxWindow *w) {
         if the window is on the visible workspace, then try focus it, and fall
         back to the default focus target if the window won't focus.
       */
-      if (! newfocus || ! newfocus->setInputFocus())
+      if (! (newfocus && newfocus->setInputFocus()))
         screen->getBlackbox()->setFocusedWindow(0);
     } else if (lastfocus == w) {
       /*
@@ -320,12 +325,6 @@ void Workspace::reconfigure(void) {
 }
 
 
-void Workspace::updateFocusModel(void) {
-  std::for_each(windowList.begin(), windowList.end(),
-                std::mem_fun(&BlackboxWindow::updateFocusModel));
-}
-
-
 BlackboxWindow *Workspace::getWindow(unsigned int index) {
   if (index < windowList.size()) {
     BlackboxWindowList::iterator it = windowList.begin();
@@ -381,8 +380,8 @@ unsigned int Workspace::getCount(void) const {
 
 
 void Workspace::appendStackOrder(BlackboxWindowList &stack_order) const {
-  BlackboxWindowList::const_iterator it = stackingList.begin();
-  const BlackboxWindowList::const_iterator end = stackingList.end();
+  BlackboxWindowList::const_reverse_iterator it = stackingList.rbegin();
+  const BlackboxWindowList::const_reverse_iterator end = stackingList.rend();
   for (; it != end; ++it)
     stack_order.push_back(*it);
 }
This page took 0.024996 seconds and 4 git commands to generate.