]> Dogcows Code - chaz/openbox/blobdiff - src/Window.cc
dont use __ for variables.. its illegal. (thanks ppl for the patch.)
[chaz/openbox] / src / Window.cc
index 98696a5671b9910538db7035bb09a72a8561f432..d696161e0929ee0d71cffbd8f865bae80efae656 100644 (file)
@@ -3072,6 +3072,9 @@ void BlackboxWindow::doMove(int x_root, int y_root) {
   doWindowSnapping(dx, dy);
 
   if (screen->doOpaqueMove()) {
+    if (screen->doWorkspaceWarping())
+      doWorkspaceWarping(x_root, y_root, dx);
+
     configure(dx, dy, frame.rect.width(), frame.rect.height());
   } else {
     XDrawRectangle(blackbox->getXDisplay(), screen->getRootWindow(),
@@ -3081,6 +3084,9 @@ void BlackboxWindow::doMove(int x_root, int y_root) {
                    frame.changing.width() - 1,
                    frame.changing.height() - 1);
 
+    if (screen->doWorkspaceWarping())
+      doWorkspaceWarping(x_root, y_root, dx);
+
     frame.changing.setPos(dx, dy);
 
     XDrawRectangle(blackbox->getXDisplay(), screen->getRootWindow(),
@@ -3091,15 +3097,11 @@ void BlackboxWindow::doMove(int x_root, int y_root) {
                    frame.changing.height() - 1);
   }
 
-  if (screen->doWorkspaceWarping())
-    doWorkspaceWarping(x_root, y_root, dx, dy);
-
   screen->showPosition(dx, dy);
 }
 
 
-void BlackboxWindow::doWorkspaceWarping(int x_root, int y_root,
-                                        int &dx, int dy) {
+void BlackboxWindow::doWorkspaceWarping(int x_root, int y_root, int &dx) {
   // workspace warping
   bool warp = False;
   unsigned int dest = screen->getCurrentWorkspaceID();
@@ -3118,8 +3120,6 @@ void BlackboxWindow::doWorkspaceWarping(int x_root, int y_root,
   if (! warp)
     return;
 
-  endMove();
-
   bool focus = flags.focused; // had focus while moving?
 
   int dest_x = x_root;
@@ -3131,28 +3131,28 @@ void BlackboxWindow::doWorkspaceWarping(int x_root, int y_root,
     dx -= screen->getRect().width() - 1;
   }
 
-  /*
-     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());
+  if (screen->doOpaqueMove())
+    XGrabServer(blackbox->getXDisplay());
 
+  XUngrabPointer(blackbox->getXDisplay(), CurrentTime);
   XWarpPointer(blackbox->getXDisplay(), None, 
                screen->getRootWindow(), 0, 0, 0, 0,
                dest_x, y_root);
+  XGrabPointer(blackbox->getXDisplay(), frame.window, False,
+               PointerMotionMask | ButtonReleaseMask,
+               GrabModeAsync, GrabModeAsync,
+               None, blackbox->getMoveCursor(), CurrentTime);
 
-  XUngrabServer(blackbox->getXDisplay());
+  if (screen->doOpaqueMove())
+    XUngrabServer(blackbox->getXDisplay());
 
   if (focus)
     setInputFocus();
 
-  beginMove(dest_x, y_root);
 }
 
 
This page took 0.024396 seconds and 4 git commands to generate.