]> Dogcows Code - chaz/openbox/blobdiff - src/Workspace.cc
caps
[chaz/openbox] / src / Workspace.cc
index 7cd21f1c281f0187916bc88c58ac60b90407e134..11d5187ddf35512a8a9cfbc69fecff71d3f16c91 100644 (file)
@@ -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);
 
This page took 0.021576 seconds and 4 git commands to generate.