X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FWorkspace.cc;h=90a83b2678a43a531dd78f214b668b2fb1055299;hb=ed27f24191f4d9651db9add2c0c7bac15d62ed27;hp=2aaf80eeb35f9a54b0b0260a47e97abe1909557a;hpb=351a06655bdd7d440780b5bc5b255081c888044b;p=chaz%2Fopenbox diff --git a/src/Workspace.cc b/src/Workspace.cc index 2aaf80ee..90a83b26 100644 --- a/src/Workspace.cc +++ b/src/Workspace.cc @@ -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) { /*