Author: olivier
Date: 2008-05-17 08:22:17 +0000 (Sat, 17 May 2008)
New Revision: 26966

Modified:
   xfwm4/branches/xfce_4_4/NEWS
   xfwm4/branches/xfce_4_4/src/client.c
   xfwm4/branches/xfce_4_4/src/placement.c
Log:
Fix automaximize on move

Modified: xfwm4/branches/xfce_4_4/NEWS
===================================================================
--- xfwm4/branches/xfce_4_4/NEWS        2008-05-16 17:27:59 UTC (rev 26965)
+++ xfwm4/branches/xfce_4_4/NEWS        2008-05-17 08:22:17 UTC (rev 26966)
@@ -1,3 +1,8 @@
+4.4.3
+=====
+
+- Fix automaximize on move
+
 4.4.2
 =====
 

Modified: xfwm4/branches/xfce_4_4/src/client.c
===================================================================
--- xfwm4/branches/xfce_4_4/src/client.c        2008-05-16 17:27:59 UTC (rev 
26965)
+++ xfwm4/branches/xfce_4_4/src/client.c        2008-05-17 08:22:17 UTC (rev 
26966)
@@ -3630,6 +3630,7 @@
         {
             int key_move = 16;
             unsigned int edge;
+            int direction = 0;
 
             if ((screen_info->params->snap_to_border) || 
(screen_info->params->snap_to_windows))
             {
@@ -3648,18 +3649,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;
             }
 
@@ -3675,14 +3680,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))
                     {
@@ -3690,14 +3695,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))
                     {

Modified: xfwm4/branches/xfce_4_4/src/placement.c
===================================================================
--- xfwm4/branches/xfce_4_4/src/placement.c     2008-05-16 17:27:59 UTC (rev 
26965)
+++ xfwm4/branches/xfce_4_4/src/placement.c     2008-05-17 08:22:17 UTC (rev 
26966)
@@ -390,7 +390,7 @@
             frame_y = frameY (c);
             ret |= CLIENT_CONSTRAINED_BOTTOM;
         }
-        if ((frame_y < disp_y) && (frame_y >= disp_y - frame_top))
+        if ((frame_y <= disp_y) && (frame_y >= disp_y - frame_top))
         {
             c->y = disp_y + frame_top;
             frame_y = frameY (c);

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

Reply via email to