all repos — fluxbox @ 6875a611dca24054ef4a116a51bd70eb98bcf0b8

custom fork of the fluxbox windowmanager

make ShowDesktop and Deiconify commands maintain focus order
Mark Tiefenbruck mark@fluxbox.org
commit

6875a611dca24054ef4a116a51bd70eb98bcf0b8

parent

e3fb16c993331de931042b3fbd4300124e2cc9eb

1 files changed, 18 insertions(+), 13 deletions(-)

jump to
M src/WorkspaceCmd.ccsrc/WorkspaceCmd.cc

@@ -488,28 +488,33 @@ BScreen *screen = Fluxbox::instance()->mouseScreen();

if (screen == 0) return; + // iconify windows in focus order, so it gets restored properly + const std::list<Focusable *> wins = + screen->focusControl().focusedOrderWinList().clientList(); + std::list<Focusable *>::const_iterator it = wins.begin(), + it_end = wins.end(); + unsigned int space = screen->currentWorkspaceID(); unsigned int count = 0; - Workspace::Windows windows(screen->currentWorkspace()->windowList()); - Workspace::Windows::iterator it = windows.begin(), - it_end = windows.end(); for (; it != it_end; ++it) { - if ((*it)->layerNum() < Layer::DESKTOP) { - (*it)->iconify(); + if (!(*it)->fbwindow()->isIconic() && ((*it)->fbwindow()->isStuck() || + (*it)->fbwindow()->workspaceNumber() == space) && + (*it)->fbwindow()->layerNum() < Layer::DESKTOP) { + (*it)->fbwindow()->iconify(); count++; } } if (count == 0) { BScreen::Icons icon_list = screen->iconList(); - BScreen::Icons::iterator icon_it = icon_list.begin(); - BScreen::Icons::iterator itend = icon_list.end(); - unsigned int space = screen->currentWorkspaceID(); + BScreen::Icons::reverse_iterator iconit = icon_list.rbegin(); + BScreen::Icons::reverse_iterator itend= icon_list.rend(); + for(; iconit != itend; iconit++) { + if ((*iconit)->workspaceNumber() == space || (*iconit)->isStuck()) + (*iconit)->deiconify(false); + } + } else + FocusControl::revertFocus(*screen); - for (; icon_it != itend; ++icon_it) { - if ((*icon_it)->isStuck() || (*icon_it)->workspaceNumber() == space) - (*icon_it)->deiconify(); - } - } } REGISTER_COMMAND(closeallwindows, CloseAllWindowsCmd, void);