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();
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) {
/*
}
-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();
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);
}