Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h borders.c icccm.c misc.c session.c 


Log Message:
Fix saving info at exit + shuffle some code around.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.276
retrieving revision 1.277
diff -u -3 -r1.276 -r1.277
--- E.h 31 May 2004 20:30:12 -0000      1.276
+++ E.h 2 Jun 2004 22:44:33 -0000       1.277
@@ -1735,7 +1735,6 @@
 void                EwinSetBorderByName(EWin * ewin, const char *name,
                                        int apply);
 void                DetermineEwinFloat(EWin * ewin, int dx, int dy);
-void                SetEInfoOnAll(void);
 EWin               *GetEwinPointerInClient(void);
 EWin               *GetEwinByCurrentPointer(void);
 EWin               *GetFocusEwin(void);
@@ -2299,6 +2298,7 @@
 int                 ICCCM_GetEInfo(EWin * ewin);
 void                ICCCM_SetMainEInfo(void);
 void                ICCCM_GetMainEInfo(void);
+void                ICCCM_SetEInfoOnAll(void);
 
 /* iclass.c */
 void                TransparencySet(int transparency);
@@ -2423,7 +2423,6 @@
 char               *EDirUser(void);
 void                EDirUserCacheSet(const char *d);
 char               *EDirUserCache(void);
-int                 EExit(int exitcode);
 void                Quicksort(void **a, int l, int r,
                              int (*CompareFunc) (void *d1, void *d2));
 void                Eprintf(const char *fmt, ...);
@@ -2512,6 +2511,7 @@
 void                MatchToSnapInfoIconbox(Iconbox * ib);
 void                SaveSession(int shutdown);
 void                autosave(void);
+int                 EExit(int exitcode);
 
 /* settings.c */
 void                SettingsPager(void);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/borders.c,v
retrieving revision 1.186
retrieving revision 1.187
diff -u -3 -r1.186 -r1.187
--- borders.c   31 May 2004 20:30:12 -0000      1.186
+++ borders.c   2 Jun 2004 22:44:33 -0000       1.187
@@ -106,22 +106,6 @@
    EDBUG_RETURN_;
 }
 
-void
-SetEInfoOnAll()
-{
-   int                 i, num;
-   EWin               *const *lst;
-
-   EDBUG(5, "SetEInfoOnAll");
-
-   lst = EwinListGetAll(&num);
-   for (i = 0; i < num; i++)
-      ICCCM_SetEInfo(lst[i]);
-   ICCCM_SetMainEInfo();
-
-   EDBUG_RETURN_;
-}
-
 EWin               *
 GetEwinByCurrentPointer(void)
 {
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/icccm.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -3 -r1.65 -r1.66
--- icccm.c     31 May 2004 20:14:50 -0000      1.65
+++ icccm.c     2 Jun 2004 22:44:33 -0000       1.66
@@ -1203,3 +1203,24 @@
      }
    EDBUG_RETURN(0);
 }
+
+void
+ICCCM_SetEInfoOnAll(void)
+{
+   int                 i, num;
+   EWin               *const *lst;
+
+   EDBUG(5, "SetEInfoOnAll");
+
+   if (EventDebug(EDBUG_TYPE_SESSION))
+      Eprintf("SetEInfoOnAll\n");
+
+   lst = EwinListGetAll(&num);
+   for (i = 0; i < num; i++)
+      if (!(lst[i]->internal))
+        ICCCM_SetEInfo(lst[i]);
+
+   ICCCM_SetMainEInfo();
+
+   EDBUG_RETURN_;
+}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/misc.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -3 -r1.57 -r1.58
--- misc.c      31 May 2004 19:47:34 -0000      1.57
+++ misc.c      2 Jun 2004 22:44:33 -0000       1.58
@@ -21,7 +21,6 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 #include "E.h"
-#include <signal.h>
 
 static char        *userDir = NULL;
 static char        *cacheDir = NULL;
@@ -113,53 +112,6 @@
    return cacheDir;
 }
 
-int
-EExit(int exitcode)
-{
-   int                 i;
-
-   EDBUG(9, "EExit");
-
-   SaveSession(1);
-
-   if (disp)
-     {
-       UngrabX();
-       UnGrabTheButtons();
-
-       /* This mechanism is only needed when the SM is unavailable: */
-       SetEInfoOnAll();
-
-       /* XSetInputFocus(disp, None, RevertToParent, CurrentTime); */
-       /* I think this is a better way to release the grabs: (felix) */
-       XSetInputFocus(disp, PointerRoot, RevertToPointerRoot, CurrentTime);
-       XSelectInput(disp, VRoot.win, 0);
-       XCloseDisplay(disp);
-     }
-
-   XSetErrorHandler((XErrorHandler) NULL);
-   XSetIOErrorHandler((XIOErrorHandler) NULL);
-
-   SignalsRestore();
-
-   if (Mode.wm.master)
-     {
-       SoundExit();
-       ThemeCleanup();
-       for (i = 0; i < child_count; i++)
-          kill(e_children[i], SIGINT);
-     }
-   else
-     {
-       exitcode = 0;
-     }
-
-   Real_SaveSnapInfo(0, NULL);
-
-   exit(exitcode);
-   EDBUG_RETURN(exitcode);
-}
-
 /* This is a general quicksort algorithm, using median-of-three strategy.
  * 
  * Parameters:
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/session.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -3 -r1.69 -r1.70
--- session.c   31 May 2004 22:54:12 -0000      1.69
+++ session.c   2 Jun 2004 22:44:33 -0000       1.70
@@ -23,6 +23,7 @@
 #include "E.h"
 #include <errno.h>
 #include <fcntl.h>
+#include <signal.h>
 #include <sys/time.h>
 
 #ifndef DEFAULT_SH_PATH
@@ -938,6 +939,9 @@
 void
 SaveSession(int shutdown)
 {
+   if (EventDebug(EDBUG_TYPE_SESSION))
+      Eprintf("SaveSession(%d)\n", shutdown);
+
    /* dont' need anymore */
    /* autosave(); */
 #ifdef HAVE_X11_SM_SMLIB_H
@@ -972,6 +976,10 @@
 doSMExit(const void *params)
 {
    char                s[1024];
+   Window              win = None;
+
+   if (EventDebug(EDBUG_TYPE_SESSION))
+      Eprintf("doSMExit: %p\n", params);
 
    restarting = True;
 
@@ -981,11 +989,8 @@
 
    SaveWindowStates();
    if (!params)
-     {
-       SaveSession(1);
-       if (disp)
-          SetEInfoOnAll();
-     }
+      SaveSession(1);
+   ICCCM_SetEInfoOnAll();
 
    if (disp)
       XSelectInput(disp, VRoot.win, 0);
@@ -1006,7 +1011,7 @@
      {
        SoundPlay("SOUND_WAIT");
        if (disp)
-          init_win_ext = MakeExtInitWin();
+          win = MakeExtInitWin();
 
        if (disp)
          {
@@ -1020,13 +1025,13 @@
                          "exec %s -single -ext_init_win %li -theme %s "
                          "-econfdir %s -ecachedir %s "
                          "-smfile %s -smid %s", command,
-                         init_win_ext, Conf.theme.name, EDirUser(),
+                         win, Conf.theme.name, EDirUser(),
                          EDirUserCache(), sm_file, sm_client_id);
             else
                Esnprintf(s, sizeof(s),
                          "exec %s -single -ext_init_win %li -theme %s "
                          "-econfdir %s -ecachedir %s "
-                         "-smfile %s", command, init_win_ext,
+                         "-smfile %s", command, win,
                          Conf.theme.name, EDirUser(), EDirUserCache(),
                          sm_file);
             execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", s, NULL);
@@ -1038,13 +1043,13 @@
                          "exec %s -single -ext_init_win %li "
                          "-econfdir %s -ecachedir %s "
                          "-smfile %s -smid %s", command,
-                         init_win_ext, EDirUser(), EDirUserCache(),
+                         win, EDirUser(), EDirUserCache(),
                          sm_file, sm_client_id);
             else
                Esnprintf(s, sizeof(s),
                          "exec %s -single -ext_init_win %li"
                          "-econfdir %s -ecachedir %s "
-                         "-smfile %s", command, init_win_ext,
+                         "-smfile %s", command, win,
                          EDirUser(), EDirUserCache(), sm_file);
             execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", s, NULL);
          }
@@ -1052,7 +1057,7 @@
    else if (!strcmp((char *)s, "restart_theme"))
      {
        SoundPlay("SOUND_WAIT");
-       init_win_ext = MakeExtInitWin();
+       win = MakeExtInitWin();
        if (atword(params, 1) && strlen((char *)params) < 1024)
          {
             sscanf(params, "%*s %1000s", s);
@@ -1067,14 +1072,14 @@
           Esnprintf(s, sizeof(s),
                     "exec %s -single -ext_init_win %li -theme %s "
                     "-econfdir %s -ecachedir %s "
-                    "-smfile %s -smid %s", command, init_win_ext,
+                    "-smfile %s -smid %s", command, win,
                     userthemepath, EDirUser(), EDirUserCache(), sm_file,
                     sm_client_id);
        else
           Esnprintf(s, sizeof(s),
                     "exec %s -ext_init_win %li -theme %s "
                     "-econfdir %s -ecachedir %s "
-                    "-smfile %s -single", command, init_win_ext,
+                    "-smfile %s -single", command, win,
                     userthemepath, EDirUser(), EDirUserCache(), sm_file);
        execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", s, NULL);
      }
@@ -1098,14 +1103,11 @@
    char                s[1024];
    char               *real_exec;
    char                sss[FILEPATH_LEN_MAX];
-   Window              w;
+   Window              win;
 
    if (!params)
-     {
-       SaveSession(1);
-       if (disp)
-          SetEInfoOnAll();
-     }
+      SaveSession(1);
+   ICCCM_SetEInfoOnAll();
 
    if (params)
      {
@@ -1117,7 +1119,7 @@
        if (!strcmp(s, "restart"))
          {
             SoundPlay("SOUND_WAIT");
-            w = MakeExtInitWin();
+            win = MakeExtInitWin();
             XCloseDisplay(disp);
             disp = NULL;
 
@@ -1126,7 +1128,7 @@
                  Esnprintf(sss, sizeof(sss),
                            "exec %s -single -ext_init_win %li -theme %s "
                            "-econfdir %s -ecachedir %s", command,
-                           w, Conf.theme.name, EDirUser(), EDirUserCache());
+                           win, Conf.theme.name, EDirUser(), EDirUserCache());
                  execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", sss, NULL);
               }
             else
@@ -1134,20 +1136,20 @@
                  Esnprintf(sss, sizeof(sss),
                            "exec %s -single -ext_init_win %li "
                            "-econfdir %s -ecachedir %s", command,
-                           w, EDirUser(), EDirUserCache());
+                           win, EDirUser(), EDirUserCache());
                  execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", sss, NULL);
               }
          }
        else if (!strcmp(s, "restart_theme"))
          {
             SoundPlay("SOUND_WAIT");
-            w = MakeExtInitWin();
+            win = MakeExtInitWin();
             XCloseDisplay(disp);
             disp = NULL;
             sscanf(params, "%*s %1000s", s);
             Esnprintf(sss, sizeof(sss),
                       "exec %s -single -ext_init_win %li -theme %s "
-                      "-econfdir %s -ecachedir %s", command, w, s,
+                      "-econfdir %s -ecachedir %s", command, win, s,
                       EDirUser(), EDirUserCache());
             execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", sss, NULL);
          }
@@ -1221,3 +1223,53 @@
    doSMExit(param);
    return 0;
 }
+
+int
+EExit(int exitcode)
+{
+   int                 i;
+
+   EDBUG(9, "EExit");
+
+   if (EventDebug(EDBUG_TYPE_SESSION))
+      Eprintf("EExit(%p)\n", exitcode);
+
+   SaveSession(1);
+
+   if (disp)
+     {
+       UngrabX();
+       UnGrabTheButtons();
+
+       /* This mechanism is only needed when the SM is unavailable: */
+       ICCCM_SetEInfoOnAll();
+
+       /* XSetInputFocus(disp, None, RevertToParent, CurrentTime); */
+       /* I think this is a better way to release the grabs: (felix) */
+       XSetInputFocus(disp, PointerRoot, RevertToPointerRoot, CurrentTime);
+       XSelectInput(disp, VRoot.win, 0);
+       XCloseDisplay(disp);
+     }
+
+   XSetErrorHandler((XErrorHandler) NULL);
+   XSetIOErrorHandler((XIOErrorHandler) NULL);
+
+   SignalsRestore();
+
+   if (Mode.wm.master)
+     {
+       SoundExit();
+       ThemeCleanup();
+       for (i = 0; i < child_count; i++)
+          kill(e_children[i], SIGINT);
+     }
+   else
+     {
+       exitcode = 0;
+     }
+
+   Real_SaveSnapInfo(0, NULL);
+
+   exit(exitcode);
+   EDBUG_RETURN(exitcode);
+}




-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to