Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h Makefile.am actions.c borders.c clone.c desktops.c ewmh.c 
        focus.c pager.c 
Added Files:
        stacking.c 


Log Message:
Maintain a global window stacking order (not entirely finished).
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.223
retrieving revision 1.224
diff -u -3 -r1.223 -r1.224
--- E.h 13 Mar 2004 22:49:47 -0000      1.223
+++ E.h 16 Mar 2004 22:10:05 -0000      1.224
@@ -1062,8 +1062,6 @@
    Window              win;
    int                 x, y;
    Background         *bg;
-   int                 num;
-   EWin              **list;
    Button             *tag;
    int                 current_area_x;
    int                 current_area_y;
@@ -1743,8 +1741,6 @@
 int                 ButtonsEventMouseOut(XEvent * ev);
 
 /* clone.c */
-Clone              *CloneEwin(EWin * ewin);
-void                FreeClone(Clone * c);
 void                RemoveClones(void);
 void                CloneDesktop(int d);
 
@@ -1818,7 +1814,6 @@
 void                SetDesktopBg(int desk, Background * bg);
 void                ConformEwinToDesktop(EWin * ewin);
 int                 DesktopAt(int x, int y);
-void                MoveStickyWindowsToCurrentDesk(void);
 void                GotoDesktop(int num);
 void                MoveDesktop(int num, int x, int y);
 void                RaiseDesktop(int num);
@@ -1831,7 +1826,6 @@
 void                MoveEwinToDesktop(EWin * ewin, int num);
 void                DesktopAddEwinToBottom(EWin * ewin);
 void                DesktopAddEwinToTop(EWin * ewin);
-void                DesktopRemoveEwin(EWin * ewin);
 void                MoveEwinToDesktopAt(EWin * ewin, int num, int x, int y);
 void                GotoDesktopByEwin(EWin * ewin);
 void                FloatEwinAboveDesktops(EWin * ewin);
@@ -2511,6 +2505,20 @@
 int                 SoundPlay(const char *name);
 int                 SoundFree(const char *name);
 
+/* stacking.c */
+typedef struct _ewinlist EWinList;
+extern EWinList     EwinListFocus;
+extern EWinList     EwinListStack;
+void                EwinListAdd(EWinList * ewl, EWin * ewin);
+void                EwinListDelete(EWinList * ewl, EWin * ewin);
+int                 EwinListRaise(EWinList * ewl, EWin * ewin, int mode);
+int                 EwinListLower(EWinList * ewl, EWin * ewin, int mode);
+EWin              **EwinListGetForDesktop(int desk, int *num);
+EWin              **EwinListGetStacking(int *num);
+int                 EwinListStackingRaise(EWin * ewin);
+int                 EwinListStackingLower(EWin * ewin);
+int                 EwinListFocusRaise(EWin * ewin);
+
 /* startup.c */
 void                AddE(void);
 void                CreateStartupDisplay(char start);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Makefile.am,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- Makefile.am 13 Mar 2004 14:03:33 -0000      1.32
+++ Makefile.am 16 Mar 2004 22:10:06 -0000      1.33
@@ -68,6 +68,7 @@
        slideout.c              \
        snaps.c                 \
        sound.c                 \
+       stacking.c              \
        startup.c               \
        sticky.c                \
        tclass.c                \
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/actions.c,v
retrieving revision 1.144
retrieving revision 1.145
diff -u -3 -r1.144 -r1.145
--- actions.c   11 Mar 2004 16:53:31 -0000      1.144
+++ actions.c   16 Mar 2004 22:10:06 -0000      1.145
@@ -1162,30 +1162,27 @@
 static int
 DoRaiseLower(EWin * ewin, void *params, int nogroup)
 {
-   EWin              **gwins;
-   int                 i, num, j, raise = 0;
+   EWin              **gwins, **lst;
+   int                 gnum, j, raise = 0;
+   int                 i, num;
 
    EDBUG(6, "doRaiseLower");
 
-   gwins = ListWinGroupMembersForEwin(ewin, ACTION_RAISE_LOWER, nogroup, &num);
-   for (j = 0; j < num; j++)
+   lst = EwinListGetForDesktop(ewin->desktop, &num);
+   gwins = ListWinGroupMembersForEwin(ewin, ACTION_RAISE_LOWER, nogroup, &gnum);
+   for (j = 0; j < gnum; j++)
      {
        ewin = gwins[j];
-       if (desks.desk[ewin->desktop].list)
+       for (i = 0; i < num - 1; i++)
          {
-            for (i = 0; i < desks.desk[ewin->desktop].num - 1; i++)
+            if (lst[i]->layer == ewin->layer &&
+                (lst[i] == ewin || !FindEwinInList(lst[i], gwins, gnum)))
               {
-                 if (desks.desk[ewin->desktop].list[i]->layer == ewin->layer
-                     && (desks.desk[ewin->desktop].list[i] == ewin
-                         || !FindEwinInList(desks.desk[ewin->desktop].list[i],
-                                            gwins, num)))
-                   {
-                      if (desks.desk[ewin->desktop].list[i] != ewin)
-                         raise = 1;
+                 if (lst[i] != ewin)
+                    raise = 1;
 
-                      j = num;
-                      break;
-                   }
+                 j = gnum;
+                 break;
               }
          }
      }
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/borders.c,v
retrieving revision 1.146
retrieving revision 1.147
diff -u -3 -r1.146 -r1.147
--- borders.c   14 Mar 2004 09:03:24 -0000      1.146
+++ borders.c   16 Mar 2004 22:10:06 -0000      1.147
@@ -149,27 +149,32 @@
 GetEwinPointerInClient(void)
 {
    Window              rt, ch;
-   int                 dum, px, py, d, i;
+   int                 dum, px, py, d;
+   EWin              **lst;
+   int                 i, num;
 
    EDBUG(5, "GetEwinPointerInClient");
-   d = DESKTOPS_WRAP_NUM(DesktopAt(mode.x, mode.y));
+
+   d = DesktopAt(mode.x, mode.y);
    XQueryPointer(disp, desks.desk[d].win, &rt, &ch, &(mode.x), &(mode.y), &dum,
                 &dum, (unsigned int *)&dum);
    px = mode.x - desks.desk[d].x;
    py = mode.y - desks.desk[d].y;
 
-   for (i = 0; i < desks.desk[d].num; i++)
+   lst = EwinListGetForDesktop(d, &num);
+   for (i = 0; i < num; i++)
      {
        int                 x, y, w, h;
 
-       x = desks.desk[d].list[i]->x;
-       y = desks.desk[d].list[i]->y;
-       w = desks.desk[d].list[i]->w;
-       h = desks.desk[d].list[i]->h;
+       x = lst[i]->x;
+       y = lst[i]->y;
+       w = lst[i]->w;
+       h = lst[i]->h;
        if ((px >= x) && (py >= y) && (px < (x + w)) && (py < (y + h))
-           && (desks.desk[d].list[i]->visible))
-          EDBUG_RETURN(desks.desk[d].list[i]);
+           && (lst[i]->visible))
+          EDBUG_RETURN(lst[i]);
      }
+
    EDBUG_RETURN(NULL);
 }
 
@@ -1319,6 +1324,9 @@
                           &att);
    FocusEwinSetGrabs(ewin);
    GrabButtonGrabs(ewin);
+   EwinListAdd(&EwinListStack, ewin);
+   EwinListAdd(&EwinListFocus, ewin);
+
    EDBUG_RETURN(ewin);
 }
 
@@ -1332,6 +1340,9 @@
    if (!ewin)
       EDBUG_RETURN_;
 
+   EwinListDelete(&EwinListStack, ewin);
+   EwinListDelete(&EwinListFocus, ewin);
+
    HintsSetClientList();
 
    if (GetZoomEWin() == ewin)
@@ -1339,8 +1350,6 @@
 
    UnmatchEwinToSnapInfo(ewin);
 
-   DesktopRemoveEwin(ewin);
-
    PagerEwinOutsideAreaUpdate(ewin);
    PagerHideAllHi();
 
@@ -1811,7 +1820,6 @@
    if (call_depth > 256)
       EDBUG_RETURN_;
    ewin->floating = 1;
-   DesktopRemoveEwin(ewin);
    ewin->desktop = 0;
    ConformEwinToDesktop(ewin);
    RaiseEwin(ewin);
@@ -1898,14 +1906,19 @@
    static int          call_depth = 0;
 
    EDBUG(3, "RaiseEwin");
-   call_depth++;
    if (call_depth > 256)
       EDBUG_RETURN_;
+   call_depth++;
 
+#if 0
+   printf("RaiseEwin %#lx %s\n", ewin->client.win, EwinGetTitle(ewin));
+#endif
    if (ewin->win)
      {
        if (ewin->floating)
-          XRaiseWindow(disp, ewin->win);
+         {
+            XRaiseWindow(disp, ewin->win);
+         }
        else
          {
             DesktopAddEwinToTop(ewin);
@@ -1925,6 +1938,7 @@
             RestackEwin(ewin);
          }
      }
+
    call_depth--;
    EDBUG_RETURN_;
 }
@@ -1935,9 +1949,13 @@
    static int          call_depth = 0;
 
    EDBUG(3, "LowerEwin");
-   call_depth++;
    if (call_depth > 256)
       EDBUG_RETURN_;
+   call_depth++;
+
+#if 0
+   printf("LowerEwin %#lx %s\n", ewin->client.win, EwinGetTitle(ewin));
+#endif
    if ((ewin->win) && (!ewin->floating))
      {
        if (ewin->has_transients)
@@ -1956,6 +1974,7 @@
        DesktopAddEwinToBottom(ewin);
        RestackEwin(ewin);
      }
+
    call_depth--;
    EDBUG_RETURN_;
 }
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/clone.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- clone.c     19 Jan 2004 22:30:28 -0000      1.12
+++ clone.c     16 Mar 2004 22:10:06 -0000      1.13
@@ -22,9 +22,13 @@
  */
 #include "E.h"
 
+#define ENABLE_CLONING 0
+
+#if ENABLE_CLONING
+
 static int          calls = 0;
 
-Clone              *
+static Clone       *
 CloneEwin(EWin * ewin)
 {
    Clone              *c;
@@ -63,16 +67,19 @@
    return c;
 }
 
-void
+static void
 FreeClone(Clone * c)
 {
    XDestroyWindow(disp, c->win);
    Efree(c);
 }
 
+#endif /* ENABLE_CLONING */
+
 void
 RemoveClones(void)
 {
+#if ENABLE_CLONING             /* FIXME What is this? */
    Clone              *c;
 
    calls--;
@@ -82,11 +89,13 @@
           FreeClone(c);
        calls = 0;
      }
+#endif
 }
 
 void
 CloneDesktop(int d)
 {
+#if ENABLE_CLONING             /* FIXME What is this? */
    int                 i, num;
    Clone             **clist = NULL;
 
@@ -136,4 +145,5 @@
          }
        Efree(clist);
      }
+#endif
 }
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -3 -r1.70 -r1.71
--- desktops.c  15 Mar 2004 17:02:55 -0000      1.70
+++ desktops.c  16 Mar 2004 22:10:06 -0000      1.71
@@ -759,8 +759,6 @@
        d = &desks.desk[i];
        d->bg = NULL;
        desks.order[i] = i;
-       d->num = 0;
-       d->list = NULL;
        d->tag = NULL;
        d->x = 0;
        d->y = 0;
@@ -1122,7 +1120,6 @@
      }
    else if (ewin->floating)
      {
-       DesktopRemoveEwin(ewin);
        xo = desks.desk[ewin->desktop].x;
        yo = desks.desk[ewin->desktop].y;
        if ((ewin->parent != root.win) && (ewin->floating == 2))
@@ -1171,39 +1168,31 @@
    EDBUG_RETURN(0);
 }
 
-void
+static void
 MoveStickyWindowsToCurrentDesk(void)
 {
    EWin              **lst, *ewin, *last_ewin;
    int                 i, num;
 
-   lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
-   if ((lst) && (num > 0))
-     {
-       last_ewin = NULL;
-       for (i = 0; i < num; i++)
-         {
-            ewin = (EWin *) lst[i];
-            if (ewin->sticky)
-              {
-                 DesktopRemoveEwin(ewin);
-                 ewin->desktop = DESKTOPS_WRAP_NUM(desks.current);
-                 ewin->parent = desks.desk[ewin->desktop].win;
-                 EReparentWindow(disp, ewin->win,
-                                 desks.desk[ewin->desktop].win, root.w,
-                                 root.h);
-                 XLowerWindow(disp, ewin->win);
-                 EMoveWindow(disp, ewin->win, ewin->x, ewin->y);
-                 DesktopAddEwinToTop(ewin);
-                 HintsSetWindowArea(ewin);
-                 HintsSetWindowDesktop(ewin);
-                 last_ewin = ewin;
-              }
-         }
-       if (last_ewin)
-          RestackEwin(last_ewin);
-       Efree(lst);
+   lst = EwinListGetStacking(&num);
+   last_ewin = NULL;
+   for (i = 0; i < num; i++)
+     {
+       ewin = lst[i];
+       if (!ewin->sticky)
+          continue;
+
+       ewin->desktop = desks.current;
+       ewin->parent = desks.desk[ewin->desktop].win;
+       EReparentWindow(disp, ewin->win,
+                       desks.desk[ewin->desktop].win, root.w, root.h);
+       EMoveWindow(disp, ewin->win, ewin->x, ewin->y);
+       HintsSetWindowArea(ewin);
+       HintsSetWindowDesktop(ewin);
+       last_ewin = ewin;
      }
+   if (last_ewin)
+      RestackEwin(last_ewin);
 }
 
 void
@@ -1289,7 +1278,8 @@
               {
                  GetWinXY(desks.desk[desk].win, &x, &y);
                  SlideWindowTo(desks.desk[desk].win, desks.desk[desk].x,
-                               desks.desk[desk].y, 0, 0, conf.desks.slidespeed);
+                               desks.desk[desk].y, 0, 0,
+                               conf.desks.slidespeed);
                  RaiseDesktop(desk);
               }
             StackDesktops();
@@ -1596,7 +1586,7 @@
        _APPEND_TO_WIN_LIST(init_win2);
      }
 
-   lst = (EWin **) ListItemType(&wnum, LIST_TYPE_EWIN);
+   lst = EwinListGetStacking(&wnum);
    blst = (Button **) ListItemType(&bnum, LIST_TYPE_BUTTON);
 
    /* Sticky buttons */
@@ -1646,9 +1636,11 @@
      }
 
    /* Normal EWins on this desk */
-   for (i = 0; i < desks.desk[desk].num; i++)
+   for (i = 0; i < wnum; i++)
      {
-       ewin = desks.desk[desk].list[i];
+       ewin = lst[i];
+       if (EwinGetDesk(ewin) != desk || ewin->floating)
+          continue;
 
        _APPEND_TO_WIN_LIST(ewin->win);
        if (ewin->win == mode.menu_win_covered)
@@ -1678,8 +1670,6 @@
 
    if (wl)
       Efree(wl);
-   if (lst)
-      Efree(lst);
    if (blst)
       Efree(blst);
 
@@ -1709,7 +1699,6 @@
    EDBUG(3, "MoveEwinToDesktop");
 /*   ewin->sticky = 0; */
    ewin->floating = 0;
-   DesktopRemoveEwin(ewin);
    pdesk = ewin->desktop;
    ewin->desktop = DESKTOPS_WRAP_NUM(desk);
    DesktopAddEwinToTop(ewin);
@@ -1735,121 +1724,32 @@
 }
 
 void
-DesktopRemoveEwin(EWin * ewin)
-{
-   int                 i, j;
-
-   EDBUG(5, "DesktopRemoveEwin");
-   if ((ewin->desktop < 0)
-       || (ewin->desktop > ENLIGHTENMENT_CONF_NUM_DESKTOPS - 1))
-      EDBUG_RETURN_;
-   for (i = 0; i < desks.desk[ewin->desktop].num; i++)
-     {
-       if (desks.desk[ewin->desktop].list[i] == ewin)
-         {
-            for (j = i; j < desks.desk[ewin->desktop].num - 1; j++)
-               desks.desk[ewin->desktop].list[j] =
-                  desks.desk[ewin->desktop].list[j + 1];
-            desks.desk[ewin->desktop].num--;
-            if (desks.desk[ewin->desktop].num <= 0)
-              {
-                 desks.desk[ewin->desktop].num = 0;
-                 if (desks.desk[ewin->desktop].list)
-                    Efree(desks.desk[ewin->desktop].list);
-                 desks.desk[ewin->desktop].list = NULL;
-              }
-            else
-              {
-                 desks.desk[ewin->desktop].list =
-                    Erealloc(desks.desk[ewin->desktop].list,
-                             desks.desk[ewin->desktop].num * sizeof(EWin *));
-              }
-            EDBUG_RETURN_;
-         }
-     }
-   EDBUG_RETURN_;
-}
-
-void
 DesktopAddEwinToTop(EWin * ewin)
 {
-   int                 i, j;
-
    EDBUG(5, "DesktopAddEwinToTop");
+
    if ((ewin->desktop < 0)
        || (ewin->desktop > ENLIGHTENMENT_CONF_NUM_DESKTOPS - 1))
       EDBUG_RETURN_;
 
-   DesktopRemoveEwin(ewin);
-   desks.desk[ewin->desktop].num++;
-   if (desks.desk[ewin->desktop].list)
-      desks.desk[ewin->desktop].list =
-        Erealloc(desks.desk[ewin->desktop].list,
-                 desks.desk[ewin->desktop].num * sizeof(EWin *));
-   else
-      desks.desk[ewin->desktop].list = Emalloc(sizeof(EWin *));
-   if (desks.desk[ewin->desktop].num == 1)
-     {
-       desks.desk[ewin->desktop].list[0] = ewin;
-       ForceUpdatePagersForDesktop(ewin->desktop);
-       EDBUG_RETURN_;
-     }
-   for (i = 0; i < desks.desk[ewin->desktop].num - 1; i++)
-     {
-       if (desks.desk[ewin->desktop].list[i]->layer <= ewin->layer)
-         {
-            for (j = desks.desk[ewin->desktop].num - 1; j > i; j--)
-               desks.desk[ewin->desktop].list[j] =
-                  desks.desk[ewin->desktop].list[j - 1];
-            desks.desk[ewin->desktop].list[i] = ewin;
-            ForceUpdatePagersForDesktop(ewin->desktop);
-            EDBUG_RETURN_;
-         }
-     }
-   desks.desk[ewin->desktop].list[desks.desk[ewin->desktop].num - 1] = ewin;
+   EwinListStackingRaise(ewin);
    ForceUpdatePagersForDesktop(ewin->desktop);
+
    EDBUG_RETURN_;
 }
 
 void
 DesktopAddEwinToBottom(EWin * ewin)
 {
-   int                 i, j;
-
    EDBUG(5, "DesktopAddEwinToBottom");
+
    if ((ewin->desktop < 0)
        || (ewin->desktop > ENLIGHTENMENT_CONF_NUM_DESKTOPS - 1))
       EDBUG_RETURN_;
 
-   DesktopRemoveEwin(ewin);
-   desks.desk[ewin->desktop].num++;
-   if (desks.desk[ewin->desktop].list)
-      desks.desk[ewin->desktop].list =
-        Erealloc(desks.desk[ewin->desktop].list,
-                 desks.desk[ewin->desktop].num * sizeof(EWin *));
-   else
-      desks.desk[ewin->desktop].list = Emalloc(sizeof(EWin *));
-   if (desks.desk[ewin->desktop].num == 1)
-     {
-       desks.desk[ewin->desktop].list[0] = ewin;
-       ForceUpdatePagersForDesktop(ewin->desktop);
-       EDBUG_RETURN_;
-     }
-   for (i = 0; i < desks.desk[ewin->desktop].num - 1; i++)
-     {
-       if (desks.desk[ewin->desktop].list[i]->layer < ewin->layer)
-         {
-            for (j = desks.desk[ewin->desktop].num - 1; j > i; j--)
-               desks.desk[ewin->desktop].list[j] =
-                  desks.desk[ewin->desktop].list[j - 1];
-            desks.desk[ewin->desktop].list[i] = ewin;
-            ForceUpdatePagersForDesktop(ewin->desktop);
-            EDBUG_RETURN_;
-         }
-     }
-   desks.desk[ewin->desktop].list[desks.desk[ewin->desktop].num - 1] = ewin;
-
+   EwinListStackingLower(ewin);
    ForceUpdatePagersForDesktop(ewin->desktop);
+
    EDBUG_RETURN_;
 }
 
@@ -1863,7 +1763,6 @@
    ewin->floating = 0;
    if (desk != ewin->desktop && !ewin->sticky)
      {
-       DesktopRemoveEwin(ewin);
        ForceUpdatePagersForDesktop(ewin->desktop);
        ewin->desktop = DESKTOPS_WRAP_NUM(desk);
        DesktopAddEwinToTop(ewin);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewmh.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -3 -r1.37 -r1.38
--- ewmh.c      14 Mar 2004 09:03:25 -0000      1.37
+++ ewmh.c      16 Mar 2004 22:10:06 -0000      1.38
@@ -167,21 +167,6 @@
 }
 
 /*
- * Return index of window in list, -1 if not found.
- * Search starts at end (utility to help finding the stacking order).
- */
-static int
-winlist_rindex(Window * wl, int len, Window win)
-{
-   int                 i;
-
-   for (i = len - 1; i >= 0; i--)
-      if (win == wl[i])
-        break;
-   return i;
-}
-
-/*
  * Initialize EWMH stuff
  */
 void
@@ -382,10 +367,11 @@
 EWMH_SetClientList(void)
 {
    Window             *wl;
-   int                 i, j, k, nwin, num;
+   int                 i, nwin, num;
    EWin              **lst;
 
    EDBUG(6, "EWMH_SetClientList");
+
    /* Mapping order */
    lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
    wl = NULL;
@@ -394,39 +380,24 @@
      {
        wl = Emalloc(sizeof(Window) * num);
        for (i = 0; i < num; i++)
-         {
-            EWin               *ewin = lst[i];
-
-            if (ewin->iconified == 4)
-               continue;
-            wl[nwin++] = ewin->client.win;
-         }
+          wl[nwin++] = lst[i]->client.win;
+       _ATOM_SET_WINDOW(_NET_CLIENT_LIST, root.win, wl, nwin);
+       Efree(lst);
      }
-   _ATOM_SET_WINDOW(_NET_CLIENT_LIST, root.win, wl, nwin);
-   if (lst)
-      Efree(lst);
 
-   /*
-    * Stacking order.
-    * We will only bother ourselves with the ones on this desktop.
-    */
-   num = desks.desk[desks.current].num;
-   lst = desks.desk[desks.current].list;
-   for (i = j = 0; i < num; i++)
-     {
-       Window              win = lst[i]->client.win;
-
-       k = winlist_rindex(wl, nwin - j, win);
-       if (k < 0)
-          continue;
-       /* Swap 'em */
-       wl[k] = wl[nwin - 1 - j];
-       wl[nwin - 1 - j] = win;
-       j++;
-     }
+   /* Stacking order */
+   lst = EwinListGetStacking(&num);
+   /* FIXME: num must be unchanged here! Check! */
+   if (num != nwin)
+      printf("*** ERROR: %s %d\n", __FILE__, __LINE__);
+   nwin = 0;
+   for (i = num - 1; i >= 0; i--)
+      wl[nwin++] = lst[i]->client.win;
    _ATOM_SET_WINDOW(_NET_CLIENT_LIST_STACKING, root.win, wl, nwin);
+
    if (wl)
       Efree(wl);
+
    EDBUG_RETURN_;
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/focus.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -3 -r1.55 -r1.56
--- focus.c     14 Mar 2004 09:03:25 -0000      1.55
+++ focus.c     16 Mar 2004 22:10:06 -0000      1.56
@@ -311,6 +311,7 @@
           NULL);
 
    SoundPlay("SOUND_FOCUS_SET");
+   EwinListFocusRaise(ewin);
  exit:
    ICCCM_Cmap(ewin);
    ICCCM_Focus(ewin);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/pager.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -3 -r1.72 -r1.73
--- pager.c     7 Mar 2004 08:14:24 -0000       1.72
+++ pager.c     16 Mar 2004 22:10:06 -0000      1.73
@@ -104,13 +104,14 @@
    p->update_phase++;
    if (p->update_phase >= p->h)
      {
-       int                 i;
+       int                 i, num;
+       EWin              **lst;
 
-       for (i = 0; i < desks.desk[p->desktop].num; i++)
-          PagerEwinUpdateFromPager(p, desks.desk[p->desktop].list[i]);
+       lst = EwinListGetForDesktop(p->desktop, &num);
+       for (i = 0; i < num; i++)
+          PagerEwinUpdateFromPager(p, lst[i]);
        p->update_phase = 0;
      }
-   val = 0;
 }
 
 Pager              *
@@ -222,9 +223,11 @@
 {
    Pager              *p = ewin->pager;
    int                 w, h;
-   int                 ax, ay, i, cx, cy;
+   int                 ax, ay, cx, cy;
    char                pq;
    ImageClass         *ic;
+   EWin              **lst;
+   int                 i, num;
 
    if (!conf.pagers.enable || !p)
       return;
@@ -271,8 +274,9 @@
      }
    queue_up = pq;
 
-   for (i = 0; i < desks.desk[p->desktop].num; i++)
-      PagerEwinUpdateMini(p, desks.desk[p->desktop].list[i]);
+   lst = EwinListGetForDesktop(p->desktop, &num);
+   for (i = 0; i < num; i++)
+      PagerEwinUpdateMini(p, lst[i]);
 }
 
 static void
@@ -581,9 +585,11 @@
 void
 PagerRedraw(Pager * p, char newbg)
 {
-   int                 i, x, y, ax, ay, cx, cy;
+   int                 x, y, ax, ay, cx, cy;
    GC                  gc;
    XGCValues           gcv;
+   EWin              **lst;
+   int                 i, num;
 
    if (!conf.pagers.enable || mode.mode == MODE_DESKSWITCH)
       return;
@@ -700,12 +706,13 @@
                          p->h / ay, x * (p->w / ax), y * (p->h / ay));
          }
 
-       for (i = desks.desk[p->desktop].num - 1; i >= 0; i--)
+       lst = EwinListGetForDesktop(p->desktop, &num);
+       for (i = num - 1; i >= 0; i--)
          {
             EWin               *ewin;
             int                 wx, wy, ww, wh;
 
-            ewin = desks.desk[p->desktop].list[i];
+            ewin = lst[i];
             if (!ewin->iconified && ewin->visible)
               {
                  wx = ((ewin->x + (cx * root.w)) * (p->w / ax)) / root.w;
@@ -749,7 +756,9 @@
 void
 PagerForceUpdate(Pager * p)
 {
-   int                 ww, hh, xx, yy, ax, ay, cx, cy, i;
+   int                 ww, hh, xx, yy, ax, ay, cx, cy;
+   EWin              **lst;
+   int                 i, num;
 
    if (!conf.pagers.enable || mode.mode == MODE_DESKSWITCH)
       return;
@@ -798,8 +807,9 @@
    ScaleRect(p->pmap, root.win, 0, 0, xx, yy, root.w, root.h, ww, hh);
    XClearWindow(disp, p->win);
 
-   for (i = 0; i < desks.desk[p->desktop].num; i++)
-      PagerEwinUpdateFromPager(p, desks.desk[p->desktop].list[i]);
+   lst = EwinListGetForDesktop(p->desktop, &num);
+   for (i = 0; i < num; i++)
+      PagerEwinUpdateFromPager(p, lst[i]);
 }
 
 void
@@ -869,7 +879,9 @@
 static EWin        *
 EwinInPagerAt(Pager * p, int x, int y)
 {
-   int                 i, wx, wy, ww, wh, ax, ay, cx, cy;
+   int                 wx, wy, ww, wh, ax, ay, cx, cy;
+   EWin              **lst;
+   int                 i, num;
 
    if (!conf.pagers.enable)
       return NULL;
@@ -877,11 +889,12 @@
    GetAreaSize(&ax, &ay);
    cx = desks.desk[p->desktop].current_area_x;
    cy = desks.desk[p->desktop].current_area_y;
-   for (i = 0; i < desks.desk[p->desktop].num; i++)
+   lst = EwinListGetForDesktop(p->desktop, &num);
+   for (i = 0; i < num; i++)
      {
        EWin               *ewin;
 
-       ewin = desks.desk[p->desktop].list[i];
+       ewin = lst[i];
        if ((ewin->visible) && (!ewin->iconified))
          {
             wx = ((ewin->x + (cx * root.w)) * (p->w / ax)) / root.w;
@@ -892,6 +905,7 @@
                return ewin;
          }
      }
+
    return NULL;
 }
 
@@ -1972,7 +1986,7 @@
    p = FindPager(win);
    if (p)
      {
-#if 0
+#if 0                          /* Nothing done here */
        PagerHandleMotion(p, win, ev->xcrossing.x, ev->xcrossing.y,
                          PAGER_EVENT_MOUSE_IN);
 #endif




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to