Author: olivier
Date: 2008-05-16 16:59:55 +0000 (Fri, 16 May 2008)
New Revision: 26964

Modified:
   xfwm4/trunk/src/client.c
Log:
Take the direction into account before wrapping workspaces (fixes bug #4090)

Modified: xfwm4/trunk/src/client.c
===================================================================
--- xfwm4/trunk/src/client.c    2008-05-15 21:51:51 UTC (rev 26963)
+++ xfwm4/trunk/src/client.c    2008-05-16 16:59:55 UTC (rev 26964)
@@ -3863,6 +3863,7 @@
         {
             int key_move = 16;
             unsigned int edge;
+            int direction = 0;
 
             if ((screen_info->params->snap_to_border) || 
(screen_info->params->snap_to_windows))
             {
@@ -3881,18 +3882,22 @@
             }
             if (xevent->xkey.keycode == 
screen_info->params->keys[KEY_MOVE_LEFT].keycode)
             {
+                direction = KEY_MOVE_LEFT;
                 c->x = c->x - key_move;
             }
             else if (xevent->xkey.keycode == 
screen_info->params->keys[KEY_MOVE_RIGHT].keycode)
             {
+                direction = KEY_MOVE_RIGHT;
                 c->x = c->x + key_move;
             }
             else if (xevent->xkey.keycode == 
screen_info->params->keys[KEY_MOVE_UP].keycode)
             {
+                direction = KEY_MOVE_UP;
                 c->y = c->y - key_move;
             }
             else if (xevent->xkey.keycode == 
screen_info->params->keys[KEY_MOVE_DOWN].keycode)
             {
+                direction = KEY_MOVE_DOWN;
                 c->y = c->y + key_move;
             }
 
@@ -3908,14 +3913,14 @@
                 maxh = screen_info->height;
                 clientMaxSpace (screen_info, &maxx, &maxy, &maxw, &maxh);
 
-                if (edge & CLIENT_CONSTRAINED_TOP)
+                if ((edge & CLIENT_CONSTRAINED_TOP) && (direction == 
KEY_MOVE_UP))
                 {
                     if (workspaceMove (screen_info, -1, 0, c, 
xevent->xkey.time))
                     {
                         c->y = maxy + maxh;
                     }
                 }
-                else if (edge & CLIENT_CONSTRAINED_BOTTOM)
+                else if ((edge & CLIENT_CONSTRAINED_BOTTOM) && (direction == 
KEY_MOVE_DOWN))
                 {
                     if (workspaceMove (screen_info, 1, 0, c, 
xevent->xkey.time))
                     {
@@ -3923,14 +3928,14 @@
                     }
                 }
 
-                if (edge & CLIENT_CONSTRAINED_LEFT)
+                if ((edge & CLIENT_CONSTRAINED_LEFT) && (direction == 
KEY_MOVE_LEFT))
                 {
                     if (workspaceMove (screen_info, 0, -1, c, 
xevent->xkey.time))
                     {
                         c->x = maxx + maxw - frameWidth (c) + frameRight (c);
                     }
                 }
-                else if (edge & CLIENT_CONSTRAINED_RIGHT)
+                else if ((edge & CLIENT_CONSTRAINED_RIGHT) && (direction == 
KEY_MOVE_RIGHT))
                 {
                     if (workspaceMove (screen_info, 0, 1, c, 
xevent->xkey.time))
                     {

_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to