diff options
| author | Dana Jansens <danakj@orodu.net> | 2002-08-20 15:38:51 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2002-08-20 15:38:51 +0000 |
| commit | 551a17d2563679eb6ef7c650f1384ee7e48dbc29 (patch) | |
| tree | 0375e12f30ae6a5530df2aae74fd27b38f502554 /src/Workspace.cc | |
| parent | 2d114880692ce90eb5c8acdc1d07d2098cc3f1fc (diff) | |
Fix send to menu, having deleted workspaces in it.
Fix workspace warping, move the mouse and window the same amount.
Fix workspace switching. Put old code back that worked better.
Diffstat (limited to 'src/Workspace.cc')
| -rw-r--r-- | src/Workspace.cc | 81 |
1 files changed, 30 insertions, 51 deletions
diff --git a/src/Workspace.cc b/src/Workspace.cc index 11d5187d..97a7ee73 100644 --- a/src/Workspace.cc +++ b/src/Workspace.cc @@ -225,6 +225,36 @@ void Workspace::removeAll(void) { windowList.front()->iconify(); } +void Workspace::showAll(void) { + BlackboxWindowList::iterator it = stackingList.begin(); + const BlackboxWindowList::iterator end = stackingList.end(); + for (; it != end; ++it) { + BlackboxWindow *bw = *it; + // not normal windows cant focus from mouse enters anyways, so we dont + // need to unmap/remap them on workspace changes + if (! bw->isStuck() || bw->isNormal()) + 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) { + BlackboxWindow *bw = *it; + // not normal windows cant focus from mouse enters anyways, so we dont + // need to unmap/remap them on workspace changes + if (! bw->isStuck() || bw->isNormal()) + bw->withdraw(); + } +} + + /* * returns the number of transients for win, plus the number of transients @@ -428,57 +458,6 @@ void Workspace::appendStackOrder(BlackboxWindowList &stack_order) const { if ((*it)->isNormal()) stack_order.push_back(*it); } - - -void Workspace::hide(void) { - BlackboxWindow *focused = screen->getBlackbox()->getFocusedWindow(); - if (focused && focused->getScreen() == screen) { - assert(focused->isStuck() || focused->getWorkspaceNumber() == id); - - lastfocus = focused; - } else { - // if no window had focus, no need to store a last focus - lastfocus = (BlackboxWindow *) 0; - } - - // when we switch workspaces, unfocus whatever was focused - screen->getBlackbox()->setFocusedWindow((BlackboxWindow *) 0); - - // withdraw windows in reverse order to minimize the number of Expose events - - BlackboxWindowList::reverse_iterator it = stackingList.rbegin(); - const BlackboxWindowList::reverse_iterator end = stackingList.rend(); - for (; it != end; ++it) { - BlackboxWindow *bw = *it; - // not normal windows cant focus from mouse enters anyways, so we dont - // need to unmap/remap them on workspace changes - if (! bw->isStuck() || bw->isNormal()) - bw->withdraw(); - } -} - - -void Workspace::show(void) { - BlackboxWindowList::iterator it = stackingList.begin(); - const BlackboxWindowList::iterator end = stackingList.end(); - for (; it != end; ++it) { - BlackboxWindow *bw = *it; - // not normal windows cant focus from mouse enters anyways, so we dont - // need to unmap/remap them on workspace changes - if (! bw->isStuck() || bw->isNormal()) - bw->show(); - } - - XSync(screen->getBlackbox()->getXDisplay(), False); - - if (screen->doFocusLast()) { - if (! screen->isSloppyFocus() && ! lastfocus && ! stackingList.empty()) - lastfocus = stackingList.front(); - - if (lastfocus) - lastfocus->setInputFocus(); - } -} bool Workspace::isCurrent(void) const { |
