summaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-07-23 04:22:42 +0000
committerDana Jansens <danakj@orodu.net>2002-07-23 04:22:42 +0000
commitbe306f6b603036ecb5d71675b6ef48324f565a73 (patch)
treeb811bc087340f56c5abc088636f20fd203993a1a /src/Window.cc
parenta41a0c1ac8742f1c5b78090f4fcda26c79520678 (diff)
add rc option for workspaceWarping
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc88
1 files changed, 45 insertions, 43 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 8119a54c..b13002d6 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -2962,55 +2962,57 @@ void BlackboxWindow::doMove(int x_root, int y_root) {
dx -= frame.border_w;
dy -= frame.border_w;
- // workspace warping
- bool warp = False;
- unsigned int dest = screen->getCurrentWorkspaceID();
- if (x_root <= 0) {
- warp = True;
+ if (screen->doWorkspaceWarping()) {
+ // workspace warping
+ bool warp = False;
+ unsigned int dest = screen->getCurrentWorkspaceID();
+ if (x_root <= 0) {
+ warp = True;
- if (dest > 0) dest--;
- else dest = screen->getNumberOfWorkspaces() - 1;
+ if (dest > 0) dest--;
+ else dest = screen->getNumberOfWorkspaces() - 1;
- } else if (x_root >= screen->getRect().right()) {
- warp = True;
+ } else if (x_root >= screen->getRect().right()) {
+ warp = True;
- if (dest < screen->getNumberOfWorkspaces() - 1) dest++;
- else dest = 0;
- }
- if (warp) {
- endMove();
- bool focus = flags.focused; // had focus while moving?
- if (! flags.stuck)
- screen->reassociateWindow(this, dest, False);
- screen->changeWorkspaceID(dest);
- if (focus)
- setInputFocus();
-
- /*
- If the XWarpPointer is done after the configure, we can end up
- grabbing another window, so made sure you do it first.
- */
- int dest_x;
- if (x_root <= 0) {
- dest_x = screen->getRect().right() - 1;
- XWarpPointer(blackbox->getXDisplay(), None,
- screen->getRootWindow(), 0, 0, 0, 0,
- dest_x, y_root);
+ if (dest < screen->getNumberOfWorkspaces() - 1) dest++;
+ else dest = 0;
+ }
+ if (warp) {
+ endMove();
+ bool focus = flags.focused; // had focus while moving?
+ if (! flags.stuck)
+ screen->reassociateWindow(this, dest, False);
+ screen->changeWorkspaceID(dest);
+ if (focus)
+ setInputFocus();
- configure(dx + (screen->getRect().width() - 1), dy,
- frame.rect.width(), frame.rect.height());
- } else {
- dest_x = 0;
- XWarpPointer(blackbox->getXDisplay(), None,
- screen->getRootWindow(), 0, 0, 0, 0,
- dest_x, y_root);
+ /*
+ If the XWarpPointer is done after the configure, we can end up
+ grabbing another window, so made sure you do it first.
+ */
+ int dest_x;
+ if (x_root <= 0) {
+ dest_x = screen->getRect().right() - 1;
+ XWarpPointer(blackbox->getXDisplay(), None,
+ screen->getRootWindow(), 0, 0, 0, 0,
+ dest_x, y_root);
+
+ configure(dx + (screen->getRect().width() - 1), dy,
+ frame.rect.width(), frame.rect.height());
+ } else {
+ dest_x = 0;
+ XWarpPointer(blackbox->getXDisplay(), None,
+ screen->getRootWindow(), 0, 0, 0, 0,
+ dest_x, y_root);
- configure(dx - (screen->getRect().width() - 1), dy,
- frame.rect.width(), frame.rect.height());
- }
+ configure(dx - (screen->getRect().width() - 1), dy,
+ frame.rect.width(), frame.rect.height());
+ }
- beginMove(dest_x, y_root);
- return;
+ beginMove(dest_x, y_root);
+ return;
+ }
}
const int snap_distance = screen->getEdgeSnapThreshold();