* ecore_exe patch to e_zone from Victor Kojouharov
authorchaos <chaos>
Sat, 15 Apr 2006 12:48:21 +0000 (12:48 +0000)
committerchaos <chaos@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 15 Apr 2006 12:48:21 +0000 (12:48 +0000)
SVN revision: 22132

src/bin/e_zone.c

index d7cffbb..643b211 100644 (file)
@@ -562,6 +562,8 @@ e_zone_exec(E_Zone *zone, char *exe)
    char *penv_display;
    char buf[4096], buf2[32];
    Ecore_Exe *ex;
+   E_App_Instance *inst = NULL;
+   E_App *a;
    
    E_OBJECT_CHECK_RETURN(zone, 0);
    E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, 0);
@@ -601,9 +603,21 @@ e_zone_exec(E_Zone *zone, char *exe)
    snprintf(buf, sizeof(buf), "E_START|%i", startup_id);
    e_util_env_set("DESKTOP_STARTUP_ID", buf);
    /* execute */
-   ex = ecore_exe_run(exe, NULL);
+   a = e_app_exe_find(exe);
+   if (!a) 
+     {
+       a = E_NEW(E_App, 1);
+       a->name = strdup (exe);
+       a->exe = strdup (exe);
+     }
+
+   inst = E_NEW(E_App_Instance, 1);
+   if (!inst) return 0;
+
+   ex = ecore_exe_pipe_run(exe, ECORE_EXE_PIPE_AUTO | ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_ERROR | ECORE_EXE_PIPE_READ_LINE_BUFFERED | ECORE_EXE_PIPE_ERROR_LINE_BUFFERED, inst);
    if (!ex)
      {
+       free(inst);
        e_error_dialog_show(_("Run Error"),
                            _("Enlightenment was unable to fork a child process:\n"
                              "\n"
@@ -612,17 +626,22 @@ e_zone_exec(E_Zone *zone, char *exe)
                            exe);
        ret = 0;
      }
-   else
-     {
-       ecore_exe_free(ex);
-       ret = 1;
-     }
    /* reset env vars */
+   else ret = 1;
    if (penv_display)
      {
        e_util_env_set("DISPLAY", penv_display);
        free(penv_display);
      }
+   /* 20 lines at start and end, 20x100 limit on bytes at each end. */
+   ecore_exe_auto_limits_set(ex, 2000, 2000, 20, 20);
+   ecore_exe_tag_set(ex, "E/app");
+   inst->app = a;
+   inst->exe = ex;
+   inst->launch_id = startup_id;
+   inst->launch_time = ecore_time_get();
+   a->instances = evas_list_append(a->instances, inst);
+   if (a->startup_notify) a->starting = 1;
    return ret;
 }