summaryrefslogtreecommitdiff
path: root/src/Workspace.cc
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-07-19 08:13:42 +0000
committerDana Jansens <danakj@orodu.net>2002-07-19 08:13:42 +0000
commit0326ac961fb82d8d7aab22e4da1859adeeceb2f7 (patch)
treea839ca8781cc6909557a6be9c72e4f785ecabb37 /src/Workspace.cc
parent23da937e01a72cbb7af5108b9620d58cc216d731 (diff)
don't try to show windows which are already shown. this also ends up fixing an elusive segfault.
Diffstat (limited to 'src/Workspace.cc')
-rw-r--r--src/Workspace.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/Workspace.cc b/src/Workspace.cc
index 9bbc617f..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();
}