[prev in list] [next in list] [prev in thread] [next in thread] 

List:       enlightenment-svn
Subject:    E CVS: apps/e sebastid
From:       enlightenment-cvs () lists ! sourceforge ! net
Date:       2005-09-29 15:43:37
Message-ID: E1EL0ZN-0000OZ-U6 () sc8-pr-cvs1 ! sourceforge ! net
[Download RAW message or body]

Enlightenment CVS committal

Author  : sebastid
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
	e_zone.c 


Log Message:
Remember startup id after restart

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_zone.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -3 -r1.77 -r1.78
--- e_zone.c	29 Sep 2005 15:15:50 -0000	1.77
+++ e_zone.c	29 Sep 2005 15:43:37 -0000	1.78
@@ -27,6 +27,8 @@
 #define E_ZONE_FLIP_DOWN(zone) (((zone)->desk_y_current + 1) < (zone)->desk_y_count)
 #define E_ZONE_FLIP_LEFT(zone) ((zone)->desk_x_current > 0)
 
+static int startup_id = 0;
+
 int
 e_zone_init(void)
 {
@@ -39,6 +41,9 @@
 int
 e_zone_shutdown(void)
 {
+   char buf[256];
+   snprintf(buf, sizeof(buf), "%i", startup_id);
+   e_util_env_set("E_STARTUP_ID", buf);
    return 1;
 }
 
@@ -527,7 +532,6 @@
 int
 e_zone_app_exec(E_Zone *zone, E_App *a)
 {
-   static int startup_id = 1;
    int ret;
    char *p1, *p2;
    char *penv_display;
@@ -536,6 +540,14 @@
    char buf[4096], buf2[32];
    
    if (!a) return 0;
+   if (!startup_id)
+     {
+	p1 = getenv("E_STARTUP_ID");
+	if (p1)
+	  startup_id = atoi(p1);
+     }
+   else
+     startup_id = 1;
    /* save previous env vars we need to save */
    penv_display = getenv("DISPLAY");
    if (penv_display) penv_display = strdup(penv_display);
@@ -581,11 +593,11 @@
    e_util_env_set("LD_PRELOAD_PATH", buf);
    snprintf(buf, sizeof(buf), "%s/enlightenment/preload/e_hack.so", e_prefix_lib_get());
  */
-   if (startup_id < 1) startup_id = 1;
-   snprintf(buf, sizeof(buf), "E_START|%i", startup_id++);
+   snprintf(buf, sizeof(buf), "E_START|%i", startup_id);
    e_util_env_set("DESKTOP_STARTUP_ID", buf);
    /* execute */
    ret = e_app_exec(a, startup_id);
+   if (++startup_id < 1) startup_id = 1;
  
    /* reset env vars */
    if (penv_display)




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic