X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2FWindow.cc;h=d696161e0929ee0d71cffbd8f865bae80efae656;hb=8a48fff773dea20ab93ee8f22b281e852b51242e;hp=835cbdecad764b3031696b084e0aa6c96424f346;hpb=9d40660bce8e594b6065db961b770d69c46ae53b;p=chaz%2Fopenbox diff --git a/src/Window.cc b/src/Window.cc index 835cbdec..d696161e 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -3065,7 +3065,6 @@ void BlackboxWindow::doMove(int x_root, int y_root) { assert(flags.moving); assert(blackbox->getChangingWindow() == this); - bool warp = False; int dx = x_root - frame.grab_x, dy = y_root - frame.grab_y; dx -= frame.border_w; dy -= frame.border_w; @@ -3074,7 +3073,7 @@ void BlackboxWindow::doMove(int x_root, int y_root) { if (screen->doOpaqueMove()) { if (screen->doWorkspaceWarping()) - warp = doWorkspaceWarping(x_root, y_root, dx, dy); + doWorkspaceWarping(x_root, y_root, dx); configure(dx, dy, frame.rect.width(), frame.rect.height()); } else { @@ -3086,7 +3085,7 @@ void BlackboxWindow::doMove(int x_root, int y_root) { frame.changing.height() - 1); if (screen->doWorkspaceWarping()) - warp = doWorkspaceWarping(x_root, y_root, dx, dy); + doWorkspaceWarping(x_root, y_root, dx); frame.changing.setPos(dx, dy); @@ -3102,8 +3101,7 @@ void BlackboxWindow::doMove(int x_root, int y_root) { } -bool 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(); @@ -3120,7 +3118,7 @@ bool BlackboxWindow::doWorkspaceWarping(int x_root, int y_root, else dest = 0; } if (! warp) - return False; + return; bool focus = flags.focused; // had focus while moving? @@ -3133,15 +3131,13 @@ bool 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. - */ - if (! flags.stuck) screen->reassociateWindow(this, dest, False); screen->changeWorkspaceID(dest); + if (screen->doOpaqueMove()) + XGrabServer(blackbox->getXDisplay()); + XUngrabPointer(blackbox->getXDisplay(), CurrentTime); XWarpPointer(blackbox->getXDisplay(), None, screen->getRootWindow(), 0, 0, 0, 0, @@ -3151,10 +3147,12 @@ bool BlackboxWindow::doWorkspaceWarping(int x_root, int y_root, GrabModeAsync, GrabModeAsync, None, blackbox->getMoveCursor(), CurrentTime); + if (screen->doOpaqueMove()) + XUngrabServer(blackbox->getXDisplay()); + if (focus) setInputFocus(); - return True; }