X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FWorkspace.cc;h=11d5187ddf35512a8a9cfbc69fecff71d3f16c91;hb=eb1f1b359f821061e1fe6a2953c8d984474c9ef4;hp=7cd21f1c281f0187916bc88c58ac60b90407e134;hpb=72c56d793b21cb0dae7a6a3d0baf580dacc4a34f;p=chaz%2Fopenbox diff --git a/src/Workspace.cc b/src/Workspace.cc index 7cd21f1c..11d5187d 100644 --- a/src/Workspace.cc +++ b/src/Workspace.cc @@ -84,7 +84,7 @@ void Workspace::addWindow(BlackboxWindow *w, bool place, bool sticky) { if (place) placeWindow(w); stackingList.push_front(w); - + if (w->isNormal()) { if (! sticky) { w->setWorkspace(id); @@ -101,9 +101,7 @@ void Workspace::addWindow(BlackboxWindow *w, bool place, bool sticky) { if (screen->doFocusNew() || (w->isTransient() && w->getTransientFor() && w->getTransientFor()->isFocused())) { - if (id == screen->getCurrentWorkspaceID()) - w->setInputFocus(); - else { + if (id != screen->getCurrentWorkspaceID()) { /* not on the focused workspace, so the window is not going to get focus but if the user wants new windows focused, then it should get focus @@ -461,8 +459,15 @@ void Workspace::hide(void) { void Workspace::show(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; + // 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);