summaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-08-20 15:38:51 +0000
committerDana Jansens <danakj@orodu.net>2002-08-20 15:38:51 +0000
commit551a17d2563679eb6ef7c650f1384ee7e48dbc29 (patch)
tree0375e12f30ae6a5530df2aae74fd27b38f502554 /src/Window.cc
parent2d114880692ce90eb5c8acdc1d07d2098cc3f1fc (diff)
Fix send to menu, having deleted workspaces in it.
Fix workspace warping, move the mouse and window the same amount. Fix workspace switching. Put old code back that worked better.
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 4824a34a..b73af2b5 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -3058,10 +3058,6 @@ void BlackboxWindow::doMove(int x_root, int y_root) {
dx -= frame.border_w;
dy -= frame.border_w;
- if (screen->doWorkspaceWarping())
- if (doWorkspaceWarping(x_root, y_root, dx, dy))
- return;
-
doWindowSnapping(dx, dy);
if (screen->doOpaqueMove()) {
@@ -3084,12 +3080,15 @@ 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);
}
-bool BlackboxWindow::doWorkspaceWarping(int x_root, int y_root,
- int dx, int dy) {
+void BlackboxWindow::doWorkspaceWarping(int x_root, int y_root,
+ int &dx, int dy) {
// workspace warping
bool warp = False;
unsigned int dest = screen->getCurrentWorkspaceID();
@@ -3106,7 +3105,7 @@ bool BlackboxWindow::doWorkspaceWarping(int x_root, int y_root,
else dest = 0;
}
if (! warp)
- return false;
+ return;
endMove();
bool focus = flags.focused; // had focus while moving?
@@ -3116,6 +3115,15 @@ bool BlackboxWindow::doWorkspaceWarping(int x_root, int y_root,
if (focus)
setInputFocus();
+ int dest_x;
+ if (x_root <= 0) {
+ dest_x = screen->getRect().right() - 1;
+ dx += screen->getRect().width() - 1;
+ } else {
+ dest_x = 0;
+ dx -= screen->getRect().width() - 1;
+ }
+
/*
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
@@ -3123,23 +3131,15 @@ bool BlackboxWindow::doWorkspaceWarping(int x_root, int y_root,
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());
- }
+
+ 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());
beginMove(dest_x, y_root);
- return true;
}