Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h areas.c borders.c draw.c edge.c moveresize.c tooltips.c 


Log Message:
Partial fix to broken floating windows (moving through edge flip, etc.).
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.263
retrieving revision 1.264
diff -u -3 -r1.263 -r1.264
--- E.h 7 May 2004 22:29:30 -0000       1.263
+++ E.h 15 May 2004 22:42:20 -0000      1.264
@@ -1271,7 +1271,6 @@
    int                 mode;
    char                place;
    char                flipp;
-   int                 next_move_x_plus, next_move_y_plus;
    Button             *button;
    int                 resize_detail;
    int                 win_x, win_y, win_w, win_h;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/areas.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -3 -r1.67 -r1.68
--- areas.c     4 May 2004 19:04:22 -0000       1.67
+++ areas.c     15 May 2004 22:42:21 -0000      1.68
@@ -243,7 +243,7 @@
 SetCurrentArea(int ax, int ay)
 {
    EWin               *const *lst, *ewin;
-   int                 i, num, a1, a2, x, y, dx, dy;
+   int                 i, num, dx, dy;
    ToolTip            *tt;
 
    EDBUG(4, "SetCurrentArea");
@@ -293,17 +293,12 @@
        for (i = 0; i < num; i++)
          {
             ewin = lst[i];
-            if (ewin->desktop != desks.current || ewin->sticky ||
-                ewin->fixedpos || ewin->iconified)
+            if (ewin->sticky || ewin->fixedpos || ewin->iconified)
+               continue;
+            if (ewin->desktop != desks.current && !ewin->floating)
                continue;
 
-            if ((ewin->floating) && (Conf.movemode > 0))
-              {
-                 wnum++;
-                 wl = Erealloc(wl, sizeof(Window) * wnum);
-                 wl[wnum - 1] = ewin->win;
-              }
-            else if (!ewin->floating)
+            if (!(ewin->floating && Conf.movemode == 0))
               {
                  wnum++;
                  wl = Erealloc(wl, sizeof(Window) * wnum);
@@ -317,73 +312,21 @@
             SlideWindowsBy(wl, wnum, -dx, -dy, Conf.desks.slidespeed);
             Efree(wl);
          }
-
-       /* move the windows to their final positions */
-       for (i = 0; i < num; i++)
-         {
-            char                setflip = 0;
-
-            ewin = lst[i];
-            if (ewin->desktop != desks.current || ewin->sticky ||
-                ewin->fixedpos || ewin->floating || ewin->client.transient_for)
-               continue;
-
-            a1 = ewin->area_x;
-            a2 = ewin->area_y;
-            if (!Mode.flipp)
-              {
-                 setflip = 1;
-                 Mode.flipp = 1;
-              }
-            MoveEwin(ewin, ewin->x - dx, ewin->y - dy);
-            if (setflip)
-               Mode.flipp = 0;
-            ewin->area_x = a1;
-            ewin->area_y = a2;
-            HintsSetWindowArea(ewin);
-         }
      }
-   else
-     {
-       /* move all windows across.... */
-       for (i = 0; i < num; i++)
-         {
-            ewin = lst[i];
-            if (ewin->desktop != desks.current || ewin->sticky ||
-                ewin->fixedpos)
-               continue;
 
-            /* if we're moving this window and its not opaque move */
-            /* warp it across without remebering the xy stuff */
-            /* well work out the xy stuff later when the move finishes */
-            if (ewin->floating)
-              {
-                 if (Conf.movemode > 0)
-                   {
-                      GetWinXY(ewin->win, &x, &y);
-                      EMoveWindow(disp, ewin->win, x - dx, y - dy);
-                   }
-              }
-            /* if we're not moving it... move it across */
-            else if (!ewin->client.transient_for)
-              {
-                 char                setflip = 0;
+   /* move all windows to their final positions */
+   for (i = 0; i < num; i++)
+     {
+       ewin = lst[i];
+       if (ewin->sticky || ewin->fixedpos)
+          continue;
+       if (ewin->client.transient_for)
+          continue;
+       if (ewin->desktop != desks.current && !ewin->floating)
+          continue;
 
-                 a1 = ewin->area_x;
-                 a2 = ewin->area_y;
-                 if (!Mode.flipp)
-                   {
-                      setflip = 1;
-                      Mode.flipp = 1;
-                   }
-                 MoveEwin(ewin, ewin->x - dx, ewin->y - dy);
-                 if (setflip)
-                    Mode.flipp = 0;
-                 ewin->area_x = a1;
-                 ewin->area_y = a2;
-                 HintsSetWindowArea(ewin);
-              }
-         }
+       if (!(ewin->floating && Conf.movemode == 0))
+          MoveEwin(ewin, ewin->x - dx, ewin->y - dy);
      }
 
    /* set hints up for it */
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/borders.c,v
retrieving revision 1.175
retrieving revision 1.176
diff -u -3 -r1.175 -r1.176
--- borders.c   7 May 2004 15:18:06 -0000       1.175
+++ borders.c   15 May 2004 22:42:21 -0000      1.176
@@ -1800,21 +1800,21 @@
        int                 i, num;
 
        lst = ListTransientsFor(ewin->client.win, &num);
-       if (lst)
+       for (i = 0; i < num; i++)
          {
-            for (i = 0; i < num; i++)
-              {
-                 if (!((Mode.flipp) && (lst[i]->floating))
-                     && (lst[i]->client.mwm_decor_border
-                         || lst[i]->client.mwm_decor_resizeh
-                         || lst[i]->client.mwm_decor_title
-                         || lst[i]->client.mwm_decor_menu
-                         || lst[i]->client.mwm_decor_minimize
-                         || lst[i]->client.mwm_decor_maximize))
-                    MoveEwin(lst[i], lst[i]->x + dx, lst[i]->y + dy);
-              }
-            Efree(lst);
+#if 0                          /* Why? */
+            if (!((Mode.flipp) && (lst[i]->floating))
+                && (lst[i]->client.mwm_decor_border
+                    || lst[i]->client.mwm_decor_resizeh
+                    || lst[i]->client.mwm_decor_title
+                    || lst[i]->client.mwm_decor_menu
+                    || lst[i]->client.mwm_decor_minimize
+                    || lst[i]->client.mwm_decor_maximize))
+#endif
+               MoveEwin(lst[i], lst[i]->x + dx, lst[i]->y + dy);
          }
+       if (lst)
+          Efree(lst);
      }
 
    if ((Mode.mode == MODE_NONE) /* && (move || resize) */ )
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/draw.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -3 -r1.46 -r1.47
--- draw.c      4 May 2004 19:04:27 -0000       1.46
+++ draw.c      15 May 2004 22:42:21 -0000      1.47
@@ -1324,10 +1324,12 @@
        ewin->client.w = w1;
        ewin->client.h = h1;
      }
+
    if ((md == 5)
        && ((Mode.mode == MODE_RESIZE) || (Mode.mode == MODE_RESIZE_H)
           || (Mode.mode == MODE_RESIZE_V) || (ewin->groups && check_move)))
       md = 0;
+
    if (md == 5)
      {
        if (VRoot.depth <= 8)
@@ -1346,10 +1348,12 @@
           md = 0;
 #endif
      }
+
    pw = w;
    ph = h;
    pq = Mode.queue_up;
    Mode.queue_up = 0;
+
    switch (md)
      {
      case 0:
@@ -1569,10 +1573,9 @@
               {
                  DO_DRAW_MODE_4(x1, y1, w1, h1);
               }
-            if (firstlast < 2)
-               if ((Mode.mode != MODE_NONE)
-                   && (!ewin->groups || (ewin->groups && !check_move)))
-                  SetCoords(ewin);
+            if ((Mode.mode != MODE_NONE)
+                && (!ewin->groups || (ewin->groups && !check_move)))
+               SetCoords(ewin);
             if (firstlast < 2)
               {
                  DO_DRAW_MODE_4(x, y, w, h);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/edge.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- edge.c      4 May 2004 19:04:27 -0000       1.2
+++ edge.c      15 May 2004 22:42:21 -0000      1.3
@@ -79,6 +79,8 @@
    if (ah == 1)
       dy = 0;
    XWarpPointer(disp, None, None, 0, 0, 0, 0, dx, dy);
+   Mode.px = Mode.x += dx;
+   Mode.py = Mode.y += dy;
    data = NULL;
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/moveresize.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- moveresize.c        9 May 2004 10:07:22 -0000       1.11
+++ moveresize.c        15 May 2004 22:42:21 -0000      1.12
@@ -69,6 +69,9 @@
                                      || Mode.swapmovemode, &num);
    for (i = 0; i < num; i++)
      {
+#if 0
+       gwins[i]->floating = 1; /* Reparent to root always */
+#endif
        FloatEwinAt(gwins[i], gwins[i]->x, gwins[i]->y);
 #if 0                          /* Will never get here */
        if (Mode.mode == MODE_MOVE)
@@ -198,32 +201,35 @@
    EDBUG_RETURN(0);
 }
 
+static int          area_x, area_y;
+
 int
 ActionMoveSuspend(void)
 {
-   EWin               *ewin;
-   int                 x, y;
+   EWin               *ewin, **lst;
+   int                 i, num;
 
    ewin = mode_moveresize_ewin;
    if (!ewin)
       return 0;
 
-   if ((Mode.mode == MODE_MOVE) && (Conf.movemode > 0))
-     {
-       x = ewin->x;
-       y = ewin->y;
-       ewin->x = -99999;
-       ewin->y = -99999;
-       ewin->reqx = -99999;
-       ewin->reqy = -99999;
-       DrawEwinShape(ewin, Conf.movemode, x, y,
-                     ewin->client.w, ewin->client.h, /*3? */ 2);
-     }
-   else
+   GetCurrentArea(&area_x, &area_y);
+
+   if (Mode.mode == MODE_MOVE_PENDING)
+      return 0;
+
+   /* If non opaque undraw our boxes */
+   if (Conf.movemode > 0)
      {
-       FloatEwinAt(ewin,
-                   ewin->x + desks.desk[ewin->desktop].x,
-                   ewin->y + desks.desk[ewin->desktop].y);
+       lst = ListWinGroupMembersForEwin(ewin, ACTION_MOVE, Mode.nogroup, &num);
+       for (i = 0; i < num; i++)
+         {
+            ewin = lst[i];
+            DrawEwinShape(ewin, Conf.movemode, ewin->x, ewin->y,
+                          ewin->client.w, ewin->client.h, 3);
+         }
+       if (lst)
+          Efree(lst);
      }
 
    return 0;
@@ -232,24 +238,57 @@
 int
 ActionMoveResume(void)
 {
-   EWin               *ewin;
-   int                 x, y;
+   EWin               *ewin, **lst;
+   int                 i, num;
+   int                 x, y, ax, ay, dx, dy, fl;
 
    ewin = mode_moveresize_ewin;
    if (!ewin)
       return 0;
 
+   fl = (Conf.movemode == 5) ? 4 : 0;
    if (Mode.mode == MODE_MOVE_PENDING)
-      Mode.mode = MODE_MOVE;
+     {
+       Mode.mode = MODE_MOVE;
+       fl = 0;                 /* This is the first time we draw it */
+     }
 
-   x = ewin->x;
-   y = ewin->y;
-   ewin->x = -99999;
-   ewin->y = -99999;
-   ewin->reqx = -99999;
-   ewin->reqy = -99999;
-   DrawEwinShape(ewin, Conf.movemode, x, y,
-                ewin->client.w, ewin->client.h, (Conf.movemode == 5) ? 4 : 0);
+   GetCurrentArea(&ax, &ay);
+   dx = (ax - area_x) * VRoot.w;
+   dy = (ay - area_y) * VRoot.h;
+
+   /* Redraw any windows that were in "move mode" */
+   lst = ListWinGroupMembersForEwin(ewin, ACTION_MOVE, Mode.nogroup, &num);
+   for (i = 0; i < num; i++)
+     {
+       ewin = lst[i];
+
+       if (!ewin->floating)
+          continue;
+
+       x = ewin->x;
+       y = ewin->y;
+       if (Mode.flipp)
+         {
+            if (Conf.movemode == 0)
+              {
+                 x -= dx;
+                 y -= dy;
+              }
+         }
+       else
+         {
+            if (Conf.movemode != 0)
+              {
+                 x += dx;
+                 y += dy;
+              }
+         }
+       DrawEwinShape(ewin, Conf.movemode, x, y,
+                     ewin->client.w, ewin->client.h, fl);
+     }
+   if (lst)
+      Efree(lst);
 
    return 0;
 }
@@ -400,16 +439,7 @@
 
    dx = Mode.x - Mode.px;
    dy = Mode.y - Mode.py;
-   if (Mode.next_move_x_plus != 0)
-     {
-       dx += Mode.next_move_x_plus;
-       Mode.next_move_x_plus = 0;
-     }
-   if (Mode.next_move_y_plus != 0)
-     {
-       dy += Mode.next_move_y_plus;
-       Mode.next_move_y_plus = 0;
-     }
+
    {
       char                jumpx, jumpy;
       int                 min_dx, max_dx, min_dy, max_dy;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/tooltips.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -3 -r1.62 -r1.63
--- tooltips.c  4 May 2004 19:04:42 -0000       1.62
+++ tooltips.c  15 May 2004 22:42:21 -0000      1.63
@@ -122,7 +122,7 @@
    Pixmap              pmap, mask;
 
    EDBUG(5, "ShowToolTip");
-   if (!tt)
+   if (!tt || Mode.mode != MODE_NONE)
       EDBUG_RETURN_;
 
    pq = Mode.queue_up;




-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to