]> Dogcows Code - chaz/openbox/commitdiff
making warping work.. hopefully.
authorDana Jansens <danakj@orodu.net>
Wed, 21 Aug 2002 07:47:52 +0000 (07:47 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 21 Aug 2002 07:47:52 +0000 (07:47 +0000)
fix for leaving !normal windows behind in the window list

src/Window.cc
src/Workspace.cc

index 7271ad0888800f7e9d5085851a1d190ad655bcba..98696a5671b9910538db7035bb09a72a8561f432 100644 (file)
@@ -3119,12 +3119,8 @@ void BlackboxWindow::doWorkspaceWarping(int x_root, int y_root,
     return;
 
   endMove();
+
   bool focus = flags.focused; // had focus while moving?
-  if (! flags.stuck)
-    screen->reassociateWindow(this, dest, False);
-  screen->changeWorkspaceID(dest);
-  if (focus)
-    setInputFocus();
 
   int dest_x = x_root;
   if (x_root <= 0) {
@@ -3136,20 +3132,26 @@ void BlackboxWindow::doWorkspaceWarping(int x_root, int y_root,
   }
 
   /*
-     We grab the X server here because we are moving the window and then the
-     mouse cursor. When one moves, it could end up putting the mouse cursor
-     over another window for a moment. This can cause the warp to iniate a
-     move on another window.
+     We grab the X server here so that we dont end up magically grabbing
+     a different window dring the warp.
   */
   XGrabServer(blackbox->getXDisplay());
 
+  if (! flags.stuck)
+    screen->reassociateWindow(this, dest, False);
+  screen->changeWorkspaceID(dest);
+
   configure(dx, dy, frame.rect.width(), frame.rect.height());
+
   XWarpPointer(blackbox->getXDisplay(), None, 
                screen->getRootWindow(), 0, 0, 0, 0,
                dest_x, y_root);
 
   XUngrabServer(blackbox->getXDisplay());
 
+  if (focus)
+    setInputFocus();
+
   beginMove(dest_x, y_root);
 }
 
index 1cb40b390b61620ba124a5c6caae99c64e630052..715d012e6b50c48da83749895205e9673ac931ab 100644 (file)
@@ -85,11 +85,18 @@ void Workspace::addWindow(BlackboxWindow *w, bool place, bool sticky) {
 
   stackingList.push_front(w);
 
-  if (w->isNormal()) {
+  if (! sticky)
+    w->setWorkspace(id);
+  
+  if (! w->isNormal()) {
     if (! sticky) {
-      w->setWorkspace(id);
-      w->setWindowNumber(windowList.size());
+      // just give it some number, else bad things happen as it is assumed to
+      // not be on a workspace
+      w->setWindowNumber(0);
     }
+  } else {
+    if (! sticky)
+      w->setWindowNumber(windowList.size());
 
     windowList.push_back(w);
 
@@ -110,11 +117,6 @@ void Workspace::addWindow(BlackboxWindow *w, bool place, bool sticky) {
         lastfocus = w;
       }
     }
-  } else {
-    w->setWorkspace(id);
-    // just give it some number, else bad things happen as it is assumed to not
-    // be on a workspace
-    w->setWindowNumber(0);
   }
 
   if (! w->isDesktop())
This page took 0.034861 seconds and 4 git commands to generate.