X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2FWorkspace.cc;h=67e191107ccb851cf01987cf28fcd77bcb5de1e6;hb=987cf7cc40d4ab9c5e895ea2b0c7a77f10a0510f;hp=f4fab1cdf6b58b290208dbb5f189808c0785f29c;hpb=cbf4bb3d62df50045fd71920256865becae21990;p=chaz%2Fopenbox diff --git a/src/Workspace.cc b/src/Workspace.cc index f4fab1cd..67e19110 100644 --- a/src/Workspace.cc +++ b/src/Workspace.cc @@ -237,9 +237,10 @@ void Workspace::showAll(void) { 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()) + // sticky windows arent unmapped on a workspace change so we don't have ot + // map them, but sometimes on a restart, another app can unmap our sticky + // windows, so we map on startup always + if (! bw->isStuck() || screen->getBlackbox()->isStartup()) bw->show(); } } @@ -254,9 +255,9 @@ void Workspace::hideAll(void) { 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()) + // don't hide sticky windows, or they'll end up flickering on a workspace + // change + if (! bw->isStuck()) bw->withdraw(); } } @@ -462,7 +463,9 @@ 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()) + // don't add desktop wnidows, or sticky windows more than once + if (! ( (*it)->isDesktop() || + ((*it)->isStuck() && id != screen->getCurrentWorkspaceID()))) stack_order.push_back(*it); } @@ -633,11 +636,24 @@ bool Workspace::smartPlacement(Rect& win) { RectList availableAreas = screen->allAvailableAreas(); RectList::iterator it, end = availableAreas.end(); - for (it = availableAreas.begin(); it != end; ++it) + for (it = availableAreas.begin(); it != end; ++it) { + Rect r = *it; + r.setRect(r.x() + screen->getSnapOffset(), + r.y() + screen->getSnapOffset(), + r.width() - screen->getSnapOffset(), + r.height() - screen->getSnapOffset()); spaces.push_back(*it); + } } else #endif // XINERAMA - spaces.push_back(screen->availableArea()); + { + Rect r = screen->availableArea(); + r.setRect(r.x() + screen->getSnapOffset(), + r.y() + screen->getSnapOffset(), + r.width() - screen->getSnapOffset(), + r.height() - screen->getSnapOffset()); + spaces.push_back(r); + } //Find Free Spaces BlackboxWindowList::const_iterator wit = windowList.begin(),