+ /*
+ 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.
+ */
+ XGrabServer(blackbox->getXDisplay());
+ int dest_x;
+ if (x_root <= 0) {
+ dest_x = screen->getRect().right() - 1;
+ configure(dx + (screen->getRect().width() - 1), dy,
+ frame.rect.width(), frame.rect.height());
+ } else {
+ dest_x = 0;
+ configure(dx - (screen->getRect().width() - 1), dy,
+ frame.rect.width(), frame.rect.height());
+ }
+ XWarpPointer(blackbox->getXDisplay(), None,
+ screen->getRootWindow(), 0, 0, 0, 0,
+ dest_x, y_root);
+ XUngrabServer(blackbox->getXDisplay());
+
+ beginMove(dest_x, y_root);
+ return true;
+}
+
+
+void BlackboxWindow::doWindowSnapping(int &dx, int &dy) {