aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-04-12 14:54:57 (GMT)
committerfluxgen <fluxgen>2002-04-12 14:54:57 (GMT)
commitaf9a5aa8a490ae3ee7ecfc98666dc869f8b72537 (patch)
treecb48bdcde337d00b80d2eb531408ae6422ea0717 /src/Window.cc
parent6075c934837f1f50770507e1e0b8b060d2935030 (diff)
downloadfluxbox-af9a5aa8a490ae3ee7ecfc98666dc869f8b72537.zip
fluxbox-af9a5aa8a490ae3ee7ecfc98666dc869f8b72537.tar.bz2
added workspace warping
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 260fa7c..e53d461 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Window.cc,v 1.42 2002/04/09 23:17:11 fluxgen Exp $ 25// $Id: Window.cc,v 1.43 2002/04/12 14:54:57 fluxgen Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -3337,11 +3337,35 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent *me) {
3337 XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), 3337 XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(),
3338 frame.move_x, frame.move_y, frame.resize_w, 3338 frame.move_x, frame.move_y, frame.resize_w,
3339 frame.resize_h); 3339 frame.resize_h);
3340 } else 3340 } else {
3341 // Warp to next or previous workspace?
3342 if (screen->isWorkspaceWarping()) {
3343 int cur_id = screen->getCurrentWorkspaceID();
3344 int new_id = cur_id;
3345 const int warpPad = screen->getEdgeSnapThreshold();
3346 if (me->x_root >= int(screen->getWidth()) - warpPad &&
3347 frame.x < int(me->x_root - frame.grab_x - screen->getBorderWidth())) {
3348 new_id = (cur_id + 1) % screen->getCount();
3349 dx = -me->x_root;
3350 } else if (me->x_root <= warpPad &&
3351 frame.x > int(me->x_root - frame.grab_x - screen->getBorderWidth())) {
3352 new_id = (cur_id - 1 + screen->getCount()) % screen->getCount();
3353 dx = screen->getWidth() - me->x_root;
3354 }
3355 if (new_id != cur_id) {
3356 frame.x += dx;
3357 XWarpPointer(display, None, None, 0, 0, 0, 0, dx, 0);
3358 screen->reassociateWindow(this, new_id, True);
3359 screen->changeWorkspaceID(new_id);
3360 setInputFocus();
3361 }
3362 }
3363
3341 configure(dx, dy, frame.width, frame.height); 3364 configure(dx, dy, frame.width, frame.height);
3365 }
3342 3366
3343 screen->showPosition(dx, dy); 3367 screen->showPosition(dx, dy);
3344 } 3368 }
3345 } else if (functions.resize && 3369 } else if (functions.resize &&
3346 (((me->state & Button1Mask) && (me->window == frame.right_grip || 3370 (((me->state & Button1Mask) && (me->window == frame.right_grip ||
3347 me->window == frame.left_grip)) || 3371 me->window == frame.left_grip)) ||