Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h evhandlers.c hints.c icccm.c ipc.c 


Log Message:
Read the WM_COMMAND property for all group members + shuffle some code around.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.302
retrieving revision 1.303
diff -u -3 -r1.302 -r1.303
--- E.h 3 Jul 2004 00:58:18 -0000       1.302
+++ E.h 4 Jul 2004 08:47:27 -0000       1.303
@@ -2350,6 +2350,7 @@
 void                ICCCM_GetHints(EWin * ewin, Atom atom_change);
 void                ICCCM_GetShapeInfo(EWin * ewin);
 void                ICCCM_SetIconSizes(void);
+void                ICCCM_ProcessPropertyChange(EWin * ewin, Atom atom_change);
 void                ICCCM_SetEInfo(EWin * ewin);
 int                 ICCCM_GetEInfo(EWin * ewin);
 void                ICCCM_SetMainEInfo(void);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/evhandlers.c,v
retrieving revision 1.170
retrieving revision 1.171
diff -u -3 -r1.170 -r1.171
--- evhandlers.c        1 Jul 2004 21:04:41 -0000       1.170
+++ evhandlers.c        4 Jul 2004 08:47:27 -0000       1.171
@@ -968,11 +968,6 @@
    EwinChangesStart(ewin);
 
    HintsProcessPropertyChange(ewin, ev->xproperty.atom);
-   ICCCM_GetTitle(ewin, ev->xproperty.atom);
-   ICCCM_GetHints(ewin, ev->xproperty.atom);
-   ICCCM_GetInfo(ewin, ev->xproperty.atom);
-   ICCCM_Cmap(ewin);
-   ICCCM_GetGeoms(ewin, ev->xproperty.atom);
    SessionGetInfo(ewin, ev->xproperty.atom);
    SyncBorderToEwin(ewin);
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/hints.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -3 -r1.24 -r1.25
--- hints.c     30 Jun 2004 13:04:00 -0000      1.24
+++ hints.c     4 Jul 2004 08:47:28 -0000       1.25
@@ -295,13 +295,25 @@
 void
 HintsProcessPropertyChange(EWin * ewin, Atom atom_change)
 {
+   char               *name;
+
    EDBUG(6, "HintsHandlePropertyChange");
-#if 0                          /* No! - ENABLE_GNOME */
-   GNOME_GetHints(ewin, atom_change);
-#endif
+
+   name = XGetAtomName(disp, atom_change);
+   if (name == NULL)
+      EDBUG_RETURN_;
+
+   if (!memcmp(name, "WM_", 3))
+      ICCCM_ProcessPropertyChange(ewin, atom_change);
 #if ENABLE_EWMH
-   EWMH_ProcessPropertyChange(ewin, atom_change);
+   else if (!memcmp(name, "_NET_", 5))
+      EWMH_ProcessPropertyChange(ewin, atom_change);
+#endif
+#if 0                          /* No! - ENABLE_GNOME */
+   else if (!memcmp(name, "_WIN_", 5))
+      GNOME_GetHints(ewin, atom_change);
 #endif
+   XFree(name);
    EDBUG_RETURN_;
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/icccm.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -3 -r1.73 -r1.74
--- icccm.c     3 Jul 2004 00:58:19 -0000       1.73
+++ icccm.c     4 Jul 2004 08:47:28 -0000       1.74
@@ -41,7 +41,6 @@
 static Atom         E_XA_WM_HINTS = 0;
 static Atom         E_XA_WM_CLIENT_LEADER = 0;
 static Atom         E_XA_WM_TRANSIENT_FOR = 0;
-static Atom         E_XA_WM_ICON_SIZE = 0;
 
 void
 ICCCM_Init(void)
@@ -63,7 +62,6 @@
    E_XA_WM_HINTS = XInternAtom(disp, "WM_HINTS", False);
    E_XA_WM_CLIENT_LEADER = XInternAtom(disp, "WM_CLIENT_LEADER", False);
    E_XA_WM_TRANSIENT_FOR = XInternAtom(disp, "WM_TRANSIENT_FOR", False);
-   E_XA_WM_ICON_SIZE = XInternAtom(disp, "WM_ICON_SIZE", False);
 
    if (Mode.wm.window)
      {
@@ -708,13 +706,41 @@
    EDBUG_RETURN_;
 }
 
+static char        *
+WinGetWMCommand(Window win)
+{
+   int                 cargc, i, size;
+   char              **cargv, *s;
+
+   s = NULL;
+
+   if (!XGetCommand(disp, win, &cargv, &cargc))
+      return NULL;
+   if (cargc <= 0)
+      return NULL;
+
+   size = strlen(cargv[0]) + 1;
+   s = Emalloc(size);
+   strcpy(s, cargv[0]);
+   for (i = 1; i < cargc; i++)
+     {
+       size += strlen(cargv[i]) + 1;
+       s = Erealloc(s, size);
+       strcat(s, " ");
+       strcat(s, cargv[i]);
+     }
+   XFreeStringList(cargv);
+
+   return s;
+}
+
 void
 ICCCM_GetInfo(EWin * ewin, Atom atom_change)
 {
    XClassHint          hint;
    XTextProperty       xtp;
-   int                 cargc, i, size;
-   char              **cargv, *s;
+   int                 size;
+   char               *s;
 
    EDBUG(6, "ICCCM_GetInfo");
 
@@ -737,59 +763,10 @@
      {
        FREE_AND_CLEAR(ewin->icccm.wm_command);
 
-       if (XGetCommand(disp, ewin->client.win, &cargv, &cargc))
-         {
-            if (cargc > 0)
-              {
-                 size = strlen(cargv[0]) + 1;
-                 s = Emalloc(size);
-                 strcpy(s, cargv[0]);
-                 for (i = 1; i < cargc; i++)
-                   {
-                      size += strlen(cargv[i]) + 1;
-                      s = Erealloc(s, size);
-                      strcat(s, " ");
-                      strcat(s, cargv[i]);
-                   }
-                 XFreeStringList(cargv);
-                 ewin->icccm.wm_command = s;
-              }
-         }
-       else if (XGetCommand(disp, ewin->client.group, &cargv, &cargc))
-         {
-            EWin               *const *lst;
-            int                 lnum, ok = 1;
-
-            lst = EwinListGetAll(&lnum);
-            for (i = 0; i < lnum; i++)
-              {
-                 if ((lst[i] != ewin)
-                     && (lst[i]->client.group == ewin->client.group))
-                   {
-                      ok = 0;
-                      i = lnum;
-                   }
-              }
+       ewin->icccm.wm_command = WinGetWMCommand(ewin->client.win);
 
-            if (cargc > 0)
-              {
-                 if (ok)
-                   {
-                      size = strlen(cargv[0]) + 1;
-                      s = Emalloc(size);
-                      strcpy(s, cargv[0]);
-                      for (i = 1; i < cargc; i++)
-                        {
-                           size += strlen(cargv[i]) + 1;
-                           s = Erealloc(s, size);
-                           strcat(s, " ");
-                           strcat(s, cargv[i]);
-                        }
-                      ewin->icccm.wm_command = s;
-                   }
-                 XFreeStringList(cargv);
-              }
-         }
+       if (!ewin->icccm.wm_command && ewin->client.win != ewin->client.group)
+          ewin->icccm.wm_command = WinGetWMCommand(ewin->client.group);
      }
 
    if (atom_change == 0 || atom_change == E_XA_WM_CLIENT_MACHINE)
@@ -1075,6 +1052,23 @@
    EDBUG_RETURN_;
 }
 
+/*
+ * Process received window property change
+ */
+void
+ICCCM_ProcessPropertyChange(EWin * ewin, Atom atom_change)
+{
+   EDBUG(6, "ICCCM_ProcessPropertyChange");
+
+   ICCCM_GetTitle(ewin, atom_change);
+   ICCCM_GetHints(ewin, atom_change);
+   ICCCM_GetInfo(ewin, atom_change);
+   ICCCM_Cmap(ewin);
+   ICCCM_GetGeoms(ewin, atom_change);
+
+   EDBUG_RETURN_;
+}
+
 void
 ICCCM_SetEInfo(EWin * ewin)
 {
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ipc.c,v
retrieving revision 1.166
retrieving revision 1.167
diff -u -3 -r1.166 -r1.167
--- ipc.c       3 Jul 2004 00:30:49 -0000       1.166
+++ ipc.c       4 Jul 2004 08:47:28 -0000       1.167
@@ -5746,9 +5746,9 @@
             "Container window        %#10lx\n"
             "Border                  %s   lrtb %i,%i,%i,%i\n"
             "Icon window, pixmap, mask %#10lx, %#10lx, %#10lx\n"
-            "Is client group leader  %i      Client group leader %#10lx\n"
-            "Has transients          %i      Transient type  %i  Transient for 
%#10lx\n"
-            "No resize H/V           %i/%i       Shaped      %i\n"
+            "Is group leader  %i  Window group leader %#lx   Client leader %#10lx\n"
+            "Has transients   %i  Transient type  %i  Transient for %#10lx\n"
+            "No resize H/V    %i/%i       Shaped      %i\n"
             "Base, min, max, inc w/h %ix%i, %ix%i, %ix%i %ix%i\n"
             "Aspect min, max         %5.5f, %5.5f\n"
             "MWM border %i resizeh %i title %i menu %i minimize %i maximize %i\n"
@@ -5772,7 +5772,8 @@
             border->border.top, border->border.bottom,
             ewin->client.icon_win,
             ewin->client.icon_pmap, ewin->client.icon_mask,
-            ewin->client.is_group_leader, ewin->client.group,
+            ewin->client.is_group_leader,
+            ewin->client.group, ewin->client.client_leader,
             ewin->has_transients,
             ewin->client.transient, ewin->client.transient_for,
             ewin->client.no_resize_h, ewin->client.no_resize_v,




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to