X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FWorkspace.cc;h=26b48e42f0f139055b0359f08f0b0ccdfc31d928;hb=256bcbed81015bafe8f89340e5cab9114c91b930;hp=a231449dadda0b9c77d01ed2214d0b7c28b1f0b5;hpb=de6c40934f9a8752f3d7cb713a19d2a4d1287531;p=chaz%2Fopenbox diff --git a/src/Workspace.cc b/src/Workspace.cc index a231449d..26b48e42 100644 --- a/src/Workspace.cc +++ b/src/Workspace.cc @@ -184,20 +184,24 @@ void Workspace::focusFallback(const BlackboxWindow *old_window) { void Workspace::showAll(void) { - std::for_each(stackingList.begin(), stackingList.end(), - std::mem_fun(&BlackboxWindow::show)); + BlackboxWindowList::iterator it = stackingList.begin(); + const BlackboxWindowList::iterator end = stackingList.end(); + for (; it != end; ++it) { + BlackboxWindow *bw = *it; + if (! bw->isStuck()) + bw->show(); + } } void Workspace::hideAll(void) { // withdraw in reverse order to minimize the number of Expose events - - BlackboxWindowList lst(stackingList.rbegin(), stackingList.rend()); - - BlackboxWindowList::iterator it = lst.begin(); - const BlackboxWindowList::iterator end = lst.end(); - for (; it != end; ++it) { + BlackboxWindowList::reverse_iterator it = stackingList.rbegin(); + const BlackboxWindowList::reverse_iterator end = stackingList.rend(); + while (it != end) { BlackboxWindow *bw = *it; + ++it; // withdraw removes the current item from the list so we need the next + // iterator before that happens if (! bw->isStuck()) bw->withdraw(); } @@ -408,7 +412,7 @@ void Workspace::appendStackOrder(BlackboxWindowList &stack_order) const { BlackboxWindowList::const_reverse_iterator it = stackingList.rbegin(); const BlackboxWindowList::const_reverse_iterator end = stackingList.rend(); for (; it != end; ++it) - if (! (*it)->isNormal()) + if ((*it)->isNormal()) stack_order.push_back(*it); }