]> Dogcows Code - chaz/openbox/blobdiff - src/Workspace.cc
add config menu entries for all the new window snapping/resistance options
[chaz/openbox] / src / Workspace.cc
index 88541b079d09a15d9faaa2a66f16baaec44796bb..4f84cfa7e306587dbae4deb72a9dd9ec39226c7c 100644 (file)
@@ -85,14 +85,6 @@ void Workspace::addWindow(BlackboxWindow *w, bool place, bool sticky) {
 
   stackingList.push_front(w);
     
-  // if the window is sticky, then it needs to be added on all other
-  // workspaces too!
-  if (! sticky && w->isStuck()) {
-    for (unsigned int i = 0; i < screen->getWorkspaceCount(); ++i)
-      if (i != id)
-        screen->getWorkspace(i)->addWindow(w, place, True);
-  }
-
   if (w->isNormal()) {
     if (! sticky) {
       w->setWorkspace(id);
@@ -140,14 +132,6 @@ void Workspace::removeWindow(BlackboxWindow *w, bool sticky) {
     focusFallback(w);
   }
     
-  // if the window is sticky, then it needs to be removed on all other
-  // workspaces too!
-  if (! sticky && w->isStuck()) {
-    for (unsigned int i = 0; i < screen->getWorkspaceCount(); ++i)
-      if (i != id)
-        screen->getWorkspace(i)->removeWindow(w, True);
-  }
-
   if (! w->isNormal()) return;
 
   BlackboxWindowList::iterator it, end = windowList.end();
@@ -231,9 +215,10 @@ void Workspace::setFocused(const BlackboxWindow *w, bool focused) {
   for (i = 0, it = windowList.begin(); it != end; ++it, ++i)
     if (*it == w)
       break;
-  assert(it != end);
-  
-  clientmenu->setItemSelected(i, focused);
+  // if its == end, then a window thats not in the windowList
+  // got focused, such as a !isNormal() window.
+  if (it != end)
+    clientmenu->setItemSelected(i, focused);
 }
 
 
@@ -242,7 +227,10 @@ void Workspace::showAll(void) {
   const BlackboxWindowList::iterator end = stackingList.end();
   for (; it != end; ++it) {
     BlackboxWindow *bw = *it;
-    bw->show();
+    // 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();
   }
 }
 
@@ -255,7 +243,10 @@ void Workspace::hideAll(void) {
     BlackboxWindow *bw = *it;
     ++it; // withdraw removes the current item from the list so we need the next
           // iterator before that happens
-    bw->withdraw();
+    // 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();
   }
 }
 
This page took 0.024422 seconds and 4 git commands to generate.