Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


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


Log Message:
Shuffled some things around a bit.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -3 -r1.118 -r1.119
--- E.h 11 Jun 2003 19:44:58 -0000      1.118
+++ E.h 14 Jun 2003 12:03:09 -0000      1.119
@@ -2064,6 +2064,8 @@
 void                NewDeskFocus(void);
 
 /* icccm.c functions */
+void                ICCCM_Init(void);
+void                ICCCM_ProcessClientMessage(XClientMessageEvent * event);
 void                ICCCM_GetTitle(EWin * ewin, Atom atom_change);
 void                ICCCM_GetColormap(EWin * ewin);
 void                ICCCM_Delete(EWin * ewin);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/evhandlers.c,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -3 -r1.105 -r1.106
--- evhandlers.c        8 Jun 2003 13:20:53 -0000       1.105
+++ evhandlers.c        14 Jun 2003 12:03:09 -0000      1.106
@@ -40,6 +40,8 @@
 static int          last_button = 0;
 static int          pgd_x = 0, pgd_y = 0;
 
+static Atom         xa_ENL_MSG = 0;
+
 static void
 ToolTipTimeout(int val, void *data)
 {
@@ -97,11 +99,7 @@
 void
 HandleClientMessage(XEvent * ev)
 {
-   EWin               *ewin;
-
-   static Atom         a1 = 0, a6 = 0;
-
-#if DEBUG_EWMH
+#if DEBUG_HINTS
    char               *name = XGetAtomName(disp, ev->xclient.message_type);
 
    printf
@@ -111,38 +109,15 @@
        ev->xclient.data.l[3]);
    XFree(name);
 #endif
-
    EDBUG(5, "HandleClientMessage");
-   if (!a1)
-      a1 = XInternAtom(disp, "ENL_MSG", False);
-   if (!a6)
-      a6 = XInternAtom(disp, "WM_CHANGE_STATE", False);
-   if (ev->xclient.message_type == a1)
+
+   if (!xa_ENL_MSG)
+      xa_ENL_MSG = XInternAtom(disp, "ENL_MSG", False);
+   if (ev->xclient.message_type == xa_ENL_MSG)
      {
        HandleComms(ev);
        EDBUG_RETURN_;
      }
-   if (ev->xclient.message_type == a6)
-     {
-       ewin =
-          FindItem(NULL, ev->xclient.window, LIST_FINDBY_ID, LIST_TYPE_EWIN);
-       if (ewin == NULL)
-          EDBUG_RETURN_;
-       if (ev->xclient.data.l[0] == IconicState)
-         {
-            if (!(ewin->iconified))
-               IconifyEwin(ewin);
-         }
-#if 0
-       else if (ev->xclient.data.l[0] == NormalState)
-         {
-            if (ewin->iconified)
-               DeIconifyEwin(ewin);
-         }
-       HintsSetWindowState(ewin);
-#endif
-       EDBUG_RETURN_;
-     }
 
    HintsProcessClientMessage(&(ev->xclient));
 
@@ -1145,7 +1120,16 @@
    char                title[10240];
    int                 desktop;
 
+#if DEBUG_HINTS
+   char               *name = XGetAtomName(disp, ev->xproperty.atom);
+
+   printf("HandleProperty: Atom=%s(%d) id=%#x\n",
+         name, (unsigned)ev->xproperty.atom, (unsigned)ev->xproperty.window);
+   XFree(name);
+#endif
+
    EDBUG(5, "HandleProperty");
+
    win = ev->xproperty.window;
    ewin = FindItem(NULL, win, LIST_FINDBY_ID, LIST_TYPE_EWIN);
    if (ewin)
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewmh.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- ewmh.c      14 Jun 2003 11:57:07 -0000      1.16
+++ ewmh.c      14 Jun 2003 12:03:09 -0000      1.17
@@ -675,15 +675,6 @@
 {
    EWin               *ewin;
 
-#if DEBUG_EWMH
-   char               *name = XGetAtomName(disp, event->message_type);
-
-   printf
-      ("EWMH_ProcessClientMessage: ev_type=%s(%d) ev_win=%#x data[0-3]= %08lx %08lx 
%08lx %08lx\n",
-       name, (unsigned)event->message_type, (unsigned)event->window,
-       event->data.l[0], event->data.l[1], event->data.l[2], event->data.l[3]);
-   XFree(name);
-#endif
    EDBUG(6, "EWMH_ProcessClientMessage");
 
    /*
@@ -692,10 +683,12 @@
    if (event->message_type == _NET_CURRENT_DESKTOP)
      {
        GotoDesktop(event->data.l[0]);
+       goto exit;
      }
    else if (event->message_type == _NET_DESKTOP_VIEWPORT)
      {
        SetCurrentArea(event->data.l[0] / root.w, event->data.l[1] / root.h);
+       goto exit;
      }
 
    /*
@@ -864,13 +857,6 @@
 void
 EWMH_ProcessPropertyChange(EWin * ewin, Atom atom_change)
 {
-#if DEBUG_EWMH
-   char               *name = XGetAtomName(disp, atom_change);
-
-   printf("EWMH_ProcessPropertyChange: Atom=%s(%d) id=%#x\n",
-         name, atom_change, (ewin) ? ewin->client.win : 0);
-   XFree(name);
-#endif
    EDBUG(6, "EWMH_ProcessPropertyChange");
 
    if (atom_change == _NET_WM_DESKTOP)
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/hints.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- hints.c     5 May 2003 01:16:57 -0000       1.5
+++ hints.c     14 Jun 2003 12:03:09 -0000      1.6
@@ -33,6 +33,7 @@
 HintsInit(void)
 {
    EDBUG(6, "HintsInit");
+   ICCCM_Init();
 #if ENABLE_KDE
    /* ??? */
 #endif
@@ -187,7 +188,6 @@
 #if ENABLE_KDE
    int                 kde_support = 0;
 #endif
-
    EDBUG(6, "HintsSetWindowHints");
 #if ENABLE_KDE
    kde_support = mode.kde_support;
@@ -265,16 +265,26 @@
 void
 HintsProcessClientMessage(XClientMessageEvent * event)
 {
+   char               *name = XGetAtomName(disp, event->message_type);
+
    EDBUG(6, "HintsHandleClientMessage");
-#if ENABLE_KDE
-   if (mode.kde_support)
-      KDE_ProcessClientMessage(event);
+
+   if (!memcmp(name, "WM_", 3))
+      ICCCM_ProcessClientMessage(event);
+#if ENABLE_EWMH
+   else if (!memcmp(name, "_NET_", 5))
+      EWMH_ProcessClientMessage(event);
 #endif
 #if ENABLE_GNOME
-   GNOME_ProcessClientMessage(event);
+   else if (!memcmp(name, "_WIN_", 5))
+      GNOME_ProcessClientMessage(event);
 #endif
-#if ENABLE_EWMH
-   EWMH_ProcessClientMessage(event);
+#if ENABLE_KDE
+   else if (!memcmp(name, "KWM_", 4))
+     {
+       if (mode.kde_support)
+          KDE_ProcessClientMessage(event);
+     }
 #endif
    EDBUG_RETURN_;
 }
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/icccm.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -3 -r1.34 -r1.35
--- icccm.c     22 May 2003 19:15:01 -0000      1.34
+++ icccm.c     14 Jun 2003 12:03:09 -0000      1.35
@@ -23,6 +23,43 @@
  */
 #include "E.h"
 
+static Atom         xa_WM_CHANGE_STATE = 0;
+
+void
+ICCCM_Init(void)
+{
+   xa_WM_CHANGE_STATE = XInternAtom(disp, "WM_CHANGE_STATE", False);
+}
+
+void
+ICCCM_ProcessClientMessage(XClientMessageEvent * event)
+{
+   EWin               *ewin;
+
+   if (event->message_type == xa_WM_CHANGE_STATE)
+     {
+       ewin = FindItem(NULL, event->window, LIST_FINDBY_ID, LIST_TYPE_EWIN);
+       if (ewin == NULL)
+          goto exit;
+
+       if (event->data.l[0] == IconicState)
+         {
+            if (!(ewin->iconified))
+               IconifyEwin(ewin);
+         }
+#if 0
+       else if (event->data.l[0] == NormalState)
+         {
+            if (ewin->iconified)
+               DeIconifyEwin(ewin);
+         }
+       HintsSetWindowState(ewin);
+#endif
+     }
+ exit:
+   EDBUG_RETURN_;
+}
+
 void
 ICCCM_GetTitle(EWin * ewin, Atom atom_change)
 {




-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to