Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h areas.c coords.c desktops.c draw.c eobj.c ewin-ops.c 
        ewins.c iclass.c ipc.c menus.c moveresize.c 


Log Message:
Merge various client placement functions.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.420
retrieving revision 1.421
diff -u -3 -r1.420 -r1.421
--- E.h 3 May 2005 18:21:36 -0000       1.420
+++ E.h 7 May 2005 09:27:13 -0000       1.421
@@ -1605,10 +1605,10 @@
 #define EWIN_CHANGE_LAYER       (1<<4)
 #define EWIN_CHANGE_OPACITY     (1<<5)
 
+void                EwinShapeSet(EWin * ewin);
 void                EwinRefresh(EWin * ewin);
-void                EwinUpdateAfterMoveResize(EWin * ewin, int resize);
-void                FloatEwin(EWin * ewin);
-void                FloatEwinAt(EWin * ewin, int x, int y);
+void                EwinFloatAt(EWin * ewin, int x, int y);
+void                EwinUnfloatAt(EWin * ewin, int desk, int x, int y);
 void                RaiseEwin(EWin * ewin);
 void                LowerEwin(EWin * ewin);
 void                ShowEwin(EWin * ewin);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/areas.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -3 -r1.83 -r1.84
--- areas.c     25 Apr 2005 22:23:13 -0000      1.83
+++ areas.c     7 May 2005 09:27:14 -0000       1.84
@@ -221,12 +221,12 @@
             if (EoGetDesk(ewin) != DesksGetCurrent() && !EoIsFloating(ewin))
                continue;
 
-            if (!(EoIsFloating(ewin) && Conf.movres.mode_move == 0))
-              {
-                 wnum++;
-                 wl = Erealloc(wl, sizeof(EObj *) * wnum);
-                 wl[wnum - 1] = &ewin->o;
-              }
+            if (EoIsFloating(ewin) && Conf.movres.mode_move == 0)
+               continue;
+
+            wnum++;
+            wl = Erealloc(wl, sizeof(EObj *) * wnum);
+            wl[wnum - 1] = &ewin->o;
          }
 
        /* slide them */
@@ -235,7 +235,6 @@
             EobjsSlideBy(wl, wnum, -dx, -dy, Conf.desks.slidespeed);
             Efree(wl);
          }
-       dx = dy = 0;
      }
 
    /* move all windows to their final positions */
@@ -243,14 +242,16 @@
    for (i = 0; i < num; i++)
      {
        ewin = lst[i];
-       if (EoIsSticky(ewin))
-          continue;
        if (ewin->client.transient > 0)
           continue;
        if (EoGetDesk(ewin) != DesksGetCurrent() && !EoIsFloating(ewin))
           continue;
 
-       if (!(EoIsFloating(ewin) && Conf.movres.mode_move == 0))
+       if (EoIsSticky(ewin) ||
+           (EoIsFloating(ewin) && Conf.movres.mode_move == 0) ||
+           (!ewin->iconified && Conf.desks.slidein))
+          MoveEwin(ewin, EoGetX(ewin), EoGetY(ewin));
+       else
           MoveEwin(ewin, EoGetX(ewin) - dx, EoGetY(ewin) - dy);
      }
    Mode.move.check = 1;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/coords.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -3 -r1.27 -r1.28
--- coords.c    23 Apr 2005 07:31:15 -0000      1.27
+++ coords.c    7 May 2005 09:27:14 -0000       1.28
@@ -71,9 +71,13 @@
               case 0:
               case 1:
               case 2:
-                 cx = x + ((EoGetW(ewin) - cw) / 2) +
+                 cx =
+                    x + (ewin->shape_w + ewin->border->border.left +
+                         ewin->border->border.right - cw) / 2 +
                     DeskGetX(EoGetDesk(ewin));
-                 cy = y + ((EoGetH(ewin) - ch) / 2) +
+                 cy =
+                    y + (ewin->shape_h + ewin->border->border.top +
+                         ewin->border->border.bottom - ch) / 2 +
                     DeskGetY(EoGetDesk(ewin));
                  break;
               }
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v
retrieving revision 1.142
retrieving revision 1.143
diff -u -3 -r1.142 -r1.143
--- desktops.c  1 May 2005 22:26:02 -0000       1.142
+++ desktops.c  7 May 2005 09:27:14 -0000       1.143
@@ -927,12 +927,12 @@
    for (i = 0; i < num; i++)
      {
        ewin = lst[i];
-       if (!EoIsSticky(ewin))
+       if (!EoIsSticky(ewin) && !EoIsFloating(ewin))
+          continue;
+       if (ewin->client.transient > 0)
           continue;
 
-       EoReparent(ewin, desk, EoGetX(ewin), EoGetY(ewin));
-       HintsSetWindowArea(ewin);
-       HintsSetWindowDesktop(ewin);
+       MoveEwinToDesktop(ewin, desk);
      }
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/draw.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -3 -r1.64 -r1.65
--- draw.c      2 May 2005 17:24:24 -0000       1.64
+++ draw.c      7 May 2005 09:27:14 -0000       1.65
@@ -896,22 +896,6 @@
           break;
      }
 
-   if ((Mode.mode == MODE_RESIZE) || (Mode.mode == MODE_RESIZE_H)
-       || (Mode.mode == MODE_RESIZE_V))
-     {
-       w1 = ewin->client.w;
-       h1 = ewin->client.h;
-       ewin->client.w = w;
-       ewin->client.h = h;
-       ICCCM_MatchSize(ewin);
-       i = (x - ewin->shape_x) / ewin->client.w_inc;
-       j = (y - ewin->shape_y) / ewin->client.h_inc;
-       x = ewin->shape_x + (i * ewin->client.w_inc);
-       y = ewin->shape_y + (j * ewin->client.h_inc);
-       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)))
@@ -938,6 +922,7 @@
      {
      case 0:
        MoveResizeEwin(ewin, x, y, w, h);
+       EwinShapeSet(ewin);
        if (Mode.mode != MODE_NONE)
           CoordsShow(ewin);
        break;
@@ -956,6 +941,22 @@
           b3 = XCreateBitmapFromData(disp, VRoot.win, gray3_bits, gray3_width,
                                      gray3_height);
 
+       if ((Mode.mode == MODE_RESIZE) || (Mode.mode == MODE_RESIZE_H)
+           || (Mode.mode == MODE_RESIZE_V))
+         {
+            w1 = ewin->client.w;
+            h1 = ewin->client.h;
+            ewin->client.w = w;
+            ewin->client.h = h;
+            ICCCM_MatchSize(ewin);
+            i = (x - ewin->shape_x) / ewin->client.w_inc;
+            j = (y - ewin->shape_y) / ewin->client.h_inc;
+            x = ewin->shape_x + (i * ewin->client.w_inc);
+            y = ewin->shape_y + (j * ewin->client.h_inc);
+            ewin->client.w = w1;
+            ewin->client.h = h1;
+         }
+
        dx = DeskGetX(EoGetDesk(ewin));
        dy = DeskGetY(EoGetDesk(ewin));
        x1 = ewin->shape_x + dx;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/eobj.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- eobj.c      2 May 2005 22:10:59 -0000       1.25
+++ eobj.c      7 May 2005 09:27:14 -0000       1.26
@@ -32,11 +32,13 @@
        break;
 
      case EOBJ_TYPE_EWIN:
+#if 0
        if (eo->floating > 1)
           desk = 0;
        else if (eo->sticky || eo->desk < 0)
           desk = DesksGetCurrent();
        else
+#endif
           desk = desk % Conf.desks.num;
        break;
      }
@@ -116,6 +118,7 @@
    if (floating == eo->floating)
       return;
 
+#if 0
    switch (eo->type)
      {
      default:
@@ -125,6 +128,8 @@
           eo->desk = 0;
        break;
      }
+#endif
+
    eo->floating = floating;
    EobjSetLayer(eo, eo->layer);
 }
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewin-ops.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -3 -r1.28 -r1.29
--- ewin-ops.c  1 May 2005 13:29:52 -0000       1.28
+++ ewin-ops.c  7 May 2005 09:27:14 -0000       1.29
@@ -221,15 +221,51 @@
       MoveEwin(ewin, x, y);
 }
 
-#define MR_FLAGS_MOVE   1
-#define MR_FLAGS_RESIZE 2
+void
+EwinRefresh(EWin * ewin)
+{
+   if (!ewin)
+      return;
+
+   if (TransparencyEnabled())
+      EwinBorderDraw(ewin, 0, 1, 0);   /* Update the border */
+
+   if (ewin->Refresh)
+      ewin->Refresh(ewin);
+}
 
 static void
-doMoveResizeEwin(EWin * ewin, int x, int y, int w, int h, int flags)
+EwinDetermineArea(EWin * ewin)
+{
+   int                 ax, ay;
+
+   DeskGetArea(EoGetDesk(ewin), &ax, &ay);
+   ax = (EoGetX(ewin) + (EoGetW(ewin) / 2) + (ax * VRoot.w)) / VRoot.w;
+   ay = (EoGetY(ewin) + (EoGetH(ewin) / 2) + (ay * VRoot.h)) / VRoot.h;
+
+   AreaFix(&ax, &ay);
+
+   if (ax != ewin->area_x || ay != ewin->area_y)
+     {
+       ewin->area_x = ax;
+       ewin->area_y = ay;
+       HintsSetWindowArea(ewin);
+     }
+}
+
+#define MRF_DESK       (1<<0)
+#define MRF_MOVE       (1<<1)
+#define MRF_RESIZE     (1<<2)
+#define MRF_RAISE      (1<<3)
+#define MRF_FLOAT      (1<<4)
+#define MRF_UNFLOAT    (1<<5)
+
+static void
+doMoveResizeEwin(EWin * ewin, int desk, int x, int y, int w, int h, int flags)
 {
    static int          call_depth = 0;
-   int                 dx, dy, sw, sh, x0, y0;
-   char                move = 0, resize = 0;
+   int                 dx, dy, sw, sh, x0, y0, pdesk;
+   char                move, resize, reparent, raise, floating;
    EWin              **lst;
    int                 i, num;
 
@@ -238,8 +274,48 @@
    call_depth++;
 
    if (EventDebug(EDBUG_TYPE_MOVERESIZE))
-      Eprintf("doMoveResizeEwin(%d) %#lx %d+%d %d*%d %d %s\n", call_depth,
-             ewin->client.win, x, y, w, h, flags, EwinGetName(ewin));
+      Eprintf("doMoveResizeEwin(%d) %#lx f=%x d=%d %d+%d %d*%d %s\n",
+             call_depth, ewin->client.win, flags, desk, x, y, w, h,
+             EwinGetName(ewin));
+
+   pdesk = (ewin->o.stacked >= 0) ? EoGetDesk(ewin) : -1;
+   desk = desk % Conf.desks.num;
+   reparent = move = resize = raise = 0;
+   floating = EoIsFloating(ewin);
+
+   if (flags & (MRF_DESK | MRF_FLOAT | MRF_UNFLOAT))
+     {
+       if (flags & MRF_FLOAT)
+         {
+            if (EoIsFloating(ewin) == 0)
+              {
+                 desk = (pdesk < 0) ? EoGetDesk(ewin) : pdesk;
+                 floating = 1;
+              }
+            else if (EoIsFloating(ewin) == 1)
+              {
+                 desk = 0;
+                 floating = 2;
+              }
+            flags |= MRF_RAISE;
+         }
+       else if (flags & MRF_UNFLOAT)
+         {
+            floating = 0;
+            flags |= MRF_RAISE;
+         }
+       else
+         {
+            if (EoIsSticky(ewin) && !EoIsFloating(ewin))
+               desk = DesksGetCurrent();
+         }
+       if (desk != pdesk)
+          reparent = 1;
+     }
+   else
+     {
+       desk = EoGetDesk(ewin);
+     }
 
    if (Mode.mode == MODE_NONE && Mode.move.check)
      {
@@ -254,7 +330,7 @@
          {
             int                 ax, ay;
 
-            DeskGetArea(EoGetDesk(ewin), &ax, &ay);
+            DeskGetArea(desk, &ax, &ay);
             x0 = -ax * sw;
             y0 = -ay * sh;
             sw *= Conf.desks.areas_nx;
@@ -288,7 +364,10 @@
           y = y0 + sh - dy;
      }
 
-   if (flags & MR_FLAGS_MOVE)
+   if (flags & MRF_RAISE)
+      raise = 1;
+
+   if (flags & MRF_MOVE)
      {
        dx = x - EoGetX(ewin);
        dy = y - EoGetY(ewin);
@@ -296,8 +375,6 @@
           move = 1;
        ewin->client.x = x + ewin->border->border.left;
        ewin->client.y = y + ewin->border->border.top;
-       ewin->shape_x = x;
-       ewin->shape_y = y;
      }
    else
      {
@@ -306,7 +383,7 @@
        y = EoGetY(ewin);
      }
 
-   if (flags & MR_FLAGS_RESIZE)
+   if (flags & MRF_RESIZE)
      {
        if ((w != ewin->client.w) || (h != ewin->client.h))
           resize = 2;
@@ -319,10 +396,6 @@
          {
             w = EoGetW(ewin);
             h = EoGetH(ewin);
-            ewin->shape_w = w -
-               (ewin->border->border.left + ewin->border->border.right);
-            ewin->shape_h = h -
-               (ewin->border->border.top + ewin->border->border.bottom);
          }
        else
          {
@@ -330,8 +403,6 @@
                ewin->border->border.right;
             h = ewin->client.h + ewin->border->border.top +
                ewin->border->border.bottom;
-            ewin->shape_w = ewin->client.w;
-            ewin->shape_h = ewin->client.h;
          }
      }
    else
@@ -340,7 +411,24 @@
        h = EoGetH(ewin);
      }
 
-   EoMoveResize(ewin, x, y, w, h);
+#if 0
+   Eprintf("repa=%d float=%d raise=%d move=%d resz=%d\n",
+          reparent, floating, raise, move, resize);
+#endif
+
+   if (reparent)
+     {
+       EoReparent(ewin, desk, x, y);
+       HintsSetWindowDesktop(ewin);
+     }
+   else
+      EoMoveResize(ewin, x, y, w, h);
+
+   if (raise)
+     {
+       EoSetFloating(ewin, floating);
+       RaiseEwin(ewin);
+     }
 
    if (ewin->shaded == 0)
      {
@@ -360,17 +448,45 @@
    if (Mode.mode == MODE_NONE || Conf.movres.update_while_moving)
       ICCCM_Configure(ewin);
 
-   if (move)
+   if (flags & (MRF_DESK | MRF_MOVE))
      {
        lst = EwinListTransients(ewin, &num, 0);
        for (i = 0; i < num; i++)
-          MoveEwin(lst[i], EoGetX(lst[i]) + dx, EoGetY(lst[i]) + dy);
+          doMoveResizeEwin(lst[i], desk, EoGetX(lst[i]) + dx,
+                           EoGetY(lst[i]) + dy, 0, 0,
+                           flags & (MRF_DESK | MRF_MOVE));
        if (lst)
           Efree(lst);
      }
 
+   EwinDetermineArea(ewin);
+
    if ((Mode.mode == MODE_NONE) /* && (move || resize) */ )
-      EwinUpdateAfterMoveResize(ewin, resize);
+     {
+       if (TransparencyEnabled())
+          EwinBorderDraw(ewin, resize, 1, 0);  /* Update the border */
+
+       if (ewin->MoveResize)
+          ewin->MoveResize(ewin, resize);
+
+       SnapshotEwinUpdate(ewin, SNAP_USE_POS | SNAP_USE_SIZE);
+
+       ModulesSignal(ESIGNAL_EWIN_CHANGE, ewin);
+     }
+
+   if (Mode.mode == MODE_NONE && desk != pdesk)
+     {
+       SnapshotEwinUpdate(ewin, SNAP_USE_DESK);
+       if (call_depth == 1)
+         {
+            if (EoIsShown(ewin))
+              {
+                 if (pdesk >= 0)
+                    ModulesSignal(ESIGNAL_DESK_CHANGE, (void *)pdesk);
+                 ModulesSignal(ESIGNAL_DESK_CHANGE, (void *)desk);
+              }
+         }
+     }
 
    call_depth--;
 }
@@ -378,19 +494,43 @@
 void
 MoveEwin(EWin * ewin, int x, int y)
 {
-   doMoveResizeEwin(ewin, x, y, 0, 0, MR_FLAGS_MOVE);
+   doMoveResizeEwin(ewin, 0, x, y, 0, 0, MRF_MOVE);
 }
 
 void
 ResizeEwin(EWin * ewin, int w, int h)
 {
-   doMoveResizeEwin(ewin, 0, 0, w, h, MR_FLAGS_RESIZE);
+   doMoveResizeEwin(ewin, 0, 0, 0, w, h, MRF_RESIZE);
 }
 
 void
 MoveResizeEwin(EWin * ewin, int x, int y, int w, int h)
 {
-   doMoveResizeEwin(ewin, x, y, w, h, MR_FLAGS_MOVE | MR_FLAGS_RESIZE);
+   doMoveResizeEwin(ewin, 0, x, y, w, h, MRF_MOVE | MRF_RESIZE);
+}
+
+void
+MoveEwinToDesktop(EWin * ewin, int desk)
+{
+   doMoveResizeEwin(ewin, desk, 0, 0, 0, 0, MRF_DESK);
+}
+
+void
+MoveEwinToDesktopAt(EWin * ewin, int desk, int x, int y)
+{
+   doMoveResizeEwin(ewin, desk, x, y, 0, 0, MRF_DESK | MRF_MOVE);
+}
+
+void
+EwinFloatAt(EWin * ewin, int x, int y)
+{
+   doMoveResizeEwin(ewin, 0, x, y, 0, 0, MRF_MOVE | MRF_FLOAT);
+}
+
+void
+EwinUnfloatAt(EWin * ewin, int desk, int x, int y)
+{
+   doMoveResizeEwin(ewin, desk, x, y, 0, 0, MRF_MOVE | MRF_UNFLOAT);
 }
 
 void
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewins.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -3 -r1.55 -r1.56
--- ewins.c     3 May 2005 18:21:40 -0000       1.55
+++ ewins.c     7 May 2005 09:27:14 -0000       1.56
@@ -304,7 +304,7 @@
          }
 
        if (dofloat)
-          FloatEwinAt(ewin, x + xd, y + yd);
+          EwinFloatAt(ewin, x + xd, y + yd);
      }
 }
 
@@ -402,25 +402,6 @@
    Mode.context_ewin = ewin;
 }
 
-static void
-EwinDetermineArea(EWin * ewin)
-{
-   int                 ax, ay;
-
-   DeskGetArea(EoGetDesk(ewin), &ax, &ay);
-   ax = (EoGetX(ewin) + (EoGetW(ewin) / 2) + (ax * VRoot.w)) / VRoot.w;
-   ay = (EoGetY(ewin) + (EoGetH(ewin) / 2) + (ay * VRoot.h)) / VRoot.h;
-
-   AreaFix(&ax, &ay);
-
-   if (ax != ewin->area_x || ay != ewin->area_y)
-     {
-       ewin->area_x = ax;
-       ewin->area_y = ay;
-       HintsSetWindowArea(ewin);
-     }
-}
-
 /*
  * Derive frame window position from client window and border properties
  */
@@ -505,9 +486,6 @@
    ewin->client.x = x + l;
    ewin->client.y = y + t;
 
-   ewin->shape_x = x;
-   ewin->shape_y = y;
-
    EoMoveResize(ewin, x, y, ewin->client.w + l + r, ewin->client.h + t + b);
 }
 
@@ -1270,205 +1248,11 @@
 }
 
 void
-EwinRefresh(EWin * ewin)
-{
-   if (!ewin)
-      return;
-
-   if (TransparencyEnabled())
-      EwinBorderDraw(ewin, 0, 1, 0);   /* Update the border */
-
-   if (ewin->Refresh)
-      ewin->Refresh(ewin);
-}
-
-void
-EwinUpdateAfterMoveResize(EWin * ewin, int resize)
-{
-   if (!ewin)
-      return;
-
-   EwinDetermineArea(ewin);
-
-   if (TransparencyEnabled())
-      EwinBorderDraw(ewin, resize, 1, 0);      /* Update the border */
-
-   if (ewin->MoveResize)
-      ewin->MoveResize(ewin, resize);
-
-   SnapshotEwinUpdate(ewin, SNAP_USE_POS | SNAP_USE_SIZE);
-
-   ModulesSignal(ESIGNAL_EWIN_CHANGE, ewin);
-}
-
-#if 0                          /* FIXME - Remove */
-void
-EwinConformToDesktop(EWin * ewin)
-{
-   Window              dwin;
-
-   dwin = DeskGetWin(EoGetDesk(ewin));
-   if ((ewin->iconified) && (ewin->parent != dwin))
-     {
-       ewin->parent = dwin;
-       EReparentWindow(EoGetWin(ewin), dwin, EoGetX(ewin), EoGetY(ewin));
-       RaiseEwin(ewin);
-       ICCCM_Configure(ewin);
-     }
-   else if (EoIsFloating(ewin))
-     {
-       if ((ewin->parent != VRoot.win) && (EoIsFloating(ewin) == 2))
-         {
-            ewin->parent = VRoot.win;
-            EReparentWindow(EoGetWin(ewin), VRoot.win, EoGetX(ewin),
-                            EoGetY(ewin));
-            EoSetDesk(ewin, 0);
-         }
-       RaiseEwin(ewin);
-       ICCCM_Configure(ewin);
-     }
-   else if (ewin->parent != dwin)
-     {
-       ewin->parent = dwin;
-       EReparentWindow(EoGetWin(ewin), dwin, EoGetX(ewin), EoGetY(ewin));
-       RaiseEwin(ewin);
-       MoveEwin(ewin, EoGetX(ewin), EoGetY(ewin));
-     }
-   else
-     {
-       RaiseEwin(ewin);
-       MoveEwin(ewin, EoGetX(ewin), EoGetY(ewin));
-     }
-
-   EwinDetermineArea(ewin);
-   HintsSetWindowDesktop(ewin);
-}
-#endif
-
-void
-MoveEwinToDesktop(EWin * ewin, int desk)
-{
-   MoveEwinToDesktopAt(ewin, desk, EoGetX(ewin), EoGetY(ewin));
-}
-
-void
-MoveEwinToDesktopAt(EWin * ewin, int desk, int x, int y)
-{
-   EWin              **lst;
-   int                 i, num;
-   int                 pdesk, dx, dy;
-
-#if 0
-   Eprintf("MoveEwinToDesktopAt: %#lx %d->%d\n", ewin->client.win,
-          EoGetDesk(ewin), desk);
-#endif
-
-   pdesk = (ewin->o.stacked >= 0) ? EoGetDesk(ewin) : 0;
-   desk = desk % Conf.desks.num;
-
-   if (desk != pdesk && !EoIsSticky(ewin))
-     {
-       SnapshotEwinUpdate(ewin, SNAP_USE_DESK);
-       if (EoIsShown(ewin))
-          ModulesSignal(ESIGNAL_DESK_CHANGE, (void *)pdesk);
-     }
-
-   dx = x - EoGetX(ewin);
-   dy = y - EoGetY(ewin);
-   if (desk != pdesk)
-     {
-       EoReparent(ewin, desk, x, y);
-       RaiseEwin(ewin);
-       if (ewin->iconified)
-          ICCCM_Configure(ewin);
-       else
-          MoveEwin(ewin, x, y);
-     }
-   else
-     {
-       RaiseEwin(ewin);
-       MoveEwin(ewin, x, y);
-     }
-
-   EwinDetermineArea(ewin);
-   HintsSetWindowDesktop(ewin);
-
-   lst = EwinListTransients(ewin, &num, 0);
-   for (i = 0; i < num; i++)
-      MoveEwinToDesktopAt(lst[i], desk, EoGetX(lst[i]) + dx,
-                         EoGetY(lst[i]) + dy);
-   if (lst)
-      Efree(lst);
-
-   if (EoIsShown(ewin))
-      ModulesSignal(ESIGNAL_DESK_CHANGE, (void *)desk);
-}
-
-void
 EwinReparent(EWin * ewin, Window parent)
 {
    EReparentWindow(ewin->client.win, parent, 0, 0);
 }
 
-void
-FloatEwinAt(EWin * ewin, int x, int y)
-{
-   static int          call_depth = 0;
-   int                 dx, dy;
-   EWin              **lst;
-   int                 i, num, desk, pdesk;
-
-   call_depth++;
-   if (call_depth > 256)
-      return;
-
-   pdesk = EoGetDesk(ewin);
-
-   if (EoIsFloating(ewin))
-     {
-       /* Reparenting to root moves the desktop-relative coordinates */
-       dx = DeskGetX(EoGetDesk(ewin));
-       dy = DeskGetY(EoGetDesk(ewin));
-       ewin->shape_x += dx;
-       ewin->shape_y += dy;
-       ewin->req_x += dx;
-       ewin->req_y += dy;
-       EoSetFloating(ewin, 2);
-       desk = 0;
-     }
-   else
-     {
-       EoSetFloating(ewin, 1);
-       desk = pdesk;
-     }
-
-   dx = x - EoGetX(ewin);
-   dy = y - EoGetY(ewin);
-
-   if (desk != pdesk)
-     {
-       ewin->o.desk = pdesk;   /* FIXME */
-       EoReparent(ewin, desk, x, y);
-       ICCCM_Configure(ewin);
-       HintsSetWindowDesktop(ewin);
-     }
-   else
-     {
-       RaiseEwin(ewin);
-       MoveEwin(ewin, x, y);
-     }
-
-   EwinDetermineArea(ewin);
-
-   lst = EwinListTransients(ewin, &num, 0);
-   for (i = 0; i < num; i++)
-      FloatEwinAt(lst[i], EoGetX(lst[i]) + dx, EoGetY(lst[i]) + dy);
-   if (lst)
-      Efree(lst);
-
-   call_depth--;
-}
-
 /*
  * Place particular EWin at appropriate location in the window stack
  */
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/iclass.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -3 -r1.60 -r1.61
--- iclass.c    23 Apr 2005 08:28:02 -0000      1.60
+++ iclass.c    7 May 2005 09:27:14 -0000       1.61
@@ -1048,7 +1048,7 @@
           ts = TextclassGetTextState(tc, state, active, sticky);
      }
 
-   if (!expose)                        // FIXME - Hmmm
+   if (!expose)                        /* FIXME - Hmmm */
      {
        if (is->im == NULL && is->im_file)
           ImagestateRealize(is);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ipc.c,v
retrieving revision 1.215
retrieving revision 1.216
diff -u -3 -r1.215 -r1.216
--- ipc.c       27 Apr 2005 22:03:44 -0000      1.215
+++ ipc.c       7 May 2005 09:27:14 -0000       1.216
@@ -329,7 +329,7 @@
             break;
 
          case 'a':
-            IpcPrintf("%#10lx : %4d %4d %4dx%4d :: %2d : %d %d : %s\n",
+            IpcPrintf("%#10lx : %5d %5d %4dx%4d :: %2d : %d %d : %s\n",
                       e->client.win, EoGetX(e), EoGetY(e), EoGetW(e),
                       EoGetH(e), (EoIsSticky(e)) ? -1 : EoGetDesk(e),
                       e->area_x, e->area_y, SS(e->icccm.wm_name));
@@ -337,7 +337,7 @@
 
          case 'p':
             IpcPrintf
-               ("%#10lx : %4d %4d %4dx%4d :: %2d : \"%s\" \"%s\" \"%s\"\n",
+               ("%#10lx : %5d %5d %4dx%4d :: %2d : \"%s\" \"%s\" \"%s\"\n",
                 e->client.win, EoGetX(e), EoGetY(e), EoGetW(e), EoGetH(e),
                 (EoIsSticky(e)) ? -1 : EoGetDesk(e), SS(e->icccm.wm_res_name),
                 SS(e->icccm.wm_res_class), SS(e->icccm.wm_name));
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/menus.c,v
retrieving revision 1.187
retrieving revision 1.188
diff -u -3 -r1.187 -r1.188
--- menus.c     1 May 2005 11:27:42 -0000       1.187
+++ menus.c     7 May 2005 09:27:15 -0000       1.188
@@ -349,7 +349,7 @@
        if (!noshow)
          {
             ICCCM_Cmap(NULL);
-            FloatEwinAt(ewin, EoGetX(ewin), EoGetY(ewin));
+            EwinFloatAt(ewin, EoGetX(ewin), EoGetY(ewin));
             ShowEwin(ewin);
             if (Conf.menus.animate)
                EwinUnShade(ewin);
@@ -1666,7 +1666,7 @@
    Mode.move.check = 0;                /* Bypass on-screen checks */
    MoveEwin(ewin2, EoGetX(ewin) + xo, EoGetY(ewin) + yo);
    Mode.move.check = 1;
-   FloatEwinAt(ewin2, EoGetX(ewin2), EoGetY(ewin2));
+   EwinFloatAt(ewin2, EoGetX(ewin2), EoGetY(ewin2));
    RaiseEwin(ewin2);
    ShowEwin(ewin2);
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/moveresize.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -3 -r1.38 -r1.39
--- moveresize.c        2 May 2005 22:11:01 -0000       1.38
+++ moveresize.c        7 May 2005 09:27:16 -0000       1.39
@@ -28,6 +28,25 @@
 static int          move_swapcoord_y = 0;
 static int          move_mode_real = 0;
 
+void
+EwinShapeSet(EWin * ewin)
+{
+   ewin->shape_x = EoGetX(ewin);
+   ewin->shape_y = EoGetY(ewin);
+   if (ewin->shaded)
+     {
+       ewin->shape_w = EoGetW(ewin) -
+          (ewin->border->border.left + ewin->border->border.right);
+       ewin->shape_h = EoGetH(ewin) -
+          (ewin->border->border.top + ewin->border->border.bottom);
+     }
+   else
+     {
+       ewin->shape_w = ewin->client.w;
+       ewin->shape_h = ewin->client.h;
+     }
+}
+
 int
 ActionMoveStart(EWin * ewin, int grab, char constrained, int nogroup)
 {
@@ -73,7 +92,8 @@
                                      || Mode.move.swap, &num);
    for (i = 0; i < num; i++)
      {
-       FloatEwinAt(gwins[i], EoGetX(gwins[i]), EoGetY(gwins[i]));
+       EwinShapeSet(ewin);
+       EwinFloatAt(gwins[i], EoGetX(gwins[i]), EoGetY(gwins[i]));
      }
    Efree(gwins);
    move_swapcoord_x = EoGetX(ewin);
@@ -86,7 +106,8 @@
 ActionMoveEnd(EWin * ewin)
 {
    EWin              **gwins;
-   int                 d, num, i;
+   int                 num, i, desk;
+   Desk               *d1, *d2;
 
    if (ewin && ewin != mode_moveresize_ewin)
       return 0;
@@ -108,12 +129,6 @@
    gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE, Mode.nogroup
                                      || Mode.move.swap, &num);
 
-#if 0                          /* FIXME - Remove? */
-   if (Conf.movres.mode_move == 0)
-      for (i = 0; i < num; i++)
-        DetermineEwinFloat(gwins[i], 0, 0);
-#endif
-
    if (Mode.mode == MODE_MOVE)
      {
        for (i = 0; i < num; i++)
@@ -123,35 +138,24 @@
      }
    Mode.mode = MODE_NONE;
 
-   d = DesktopAt(Mode.x, Mode.y);
+   desk = DesktopAt(Mode.x, Mode.y);
+   d2 = DeskGet(desk);
 
    if (Conf.movres.mode_move == 0)
      {
        EoChangeOpacity(ewin, ewin->ewmh.opacity);
      }
+
    for (i = 0; i < num; i++)
      {
-       if ((EoIsFloating(gwins[i])) || (Conf.movres.mode_move > 0))
-         {
-            if (EoIsFloating(gwins[i]))
-              {
-                 EoSetFloating(gwins[i], 0);
-                 MoveEwinToDesktopAt(gwins[i], d,
-                                     gwins[i]->shape_x -
-                                     (DeskGetX(d) -
-                                      DeskGetX(EoGetDesk(gwins[i]))),
-                                     gwins[i]->shape_y -
-                                     (DeskGetY(d) -
-                                      DeskGetY(EoGetDesk(gwins[i]))));
-              }
-            else
-              {
-                 MoveEwinToDesktopAt(gwins[i], d, gwins[i]->shape_x,
-                                     gwins[i]->shape_y);
-              }
-         }
-
-       RaiseEwin(gwins[i]);
+       ewin = gwins[i];
+       d1 = DeskGet(EoGetDesk(ewin));
+       if (desk == d1->num)
+          EwinUnfloatAt(ewin, desk, ewin->shape_x, ewin->shape_y);
+       else
+          EwinUnfloatAt(ewin, desk,
+                        ewin->shape_x - (EoGetX(d2) - EoGetX(d1)),
+                        ewin->shape_y - (EoGetY(d2) - EoGetY(d1)));
      }
 
    ecore_x_sync();
@@ -167,8 +171,6 @@
 
    ModulesSignal(ESIGNAL_MOVE_DONE, NULL);
 
-   EwinUpdateAfterMoveResize(ewin, 0);
-
    return 0;
 }
 
@@ -346,6 +348,7 @@
    Mode.win_y = EoGetY(ewin);
    Mode.win_w = ewin->client.w;
    Mode.win_h = ewin->client.h;
+   EwinShapeSet(ewin);
    DrawEwinShape(ewin, Conf.movres.mode_resize, EoGetX(ewin), EoGetY(ewin),
                 ewin->client.w, ewin->client.h, 0);
 
@@ -384,8 +387,6 @@
 
    ModulesSignal(ESIGNAL_RESIZE_DONE, NULL);
 
-   EwinUpdateAfterMoveResize(ewin, 1);
-
    return 0;
 }
 
@@ -527,7 +528,19 @@
        /* if its opaque move mode check to see if we have to float */
        /* the window above all desktops (reparent to root) */
        if (Conf.movres.mode_move == 0)
-          DetermineEwinFloat(ewin1, ndx, ndy);
+         {
+            int                 desk;
+
+            desk = EoGetDesk(ewin1);
+            DetermineEwinFloat(ewin1, ndx, ndy);
+            if (desk != EoGetDesk(ewin1))
+              {
+                 ewin1->shape_x += DeskGetX(desk);
+                 ewin1->shape_y += DeskGetY(desk);
+                 ewin1->req_x += DeskGetX(desk);
+                 ewin1->req_y += DeskGetY(desk);
+              }
+         }
 
        /* draw the new position of the window */
        DrawEwinShape(ewin1, Conf.movres.mode_move,




-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to