discomfitor pushed a commit to branch enlightenment-0.20. http://git.enlightenment.org/core/enlightenment.git/commit/?id=b5ef01ddac61faae519c90d3eaa359e5010c0be7
commit b5ef01ddac61faae519c90d3eaa359e5010c0be7 Author: Mike Blumenkrantz <zm...@osg.samsung.com> Date: Mon Apr 18 15:27:47 2016 -0400 make startup/restart app exec timing protocol-specific this allows different display protocols to start their applications at different times to ensure that any initialization has completed prior to starting anything requiring a window fix T3475 --- src/bin/e_comp_x.c | 1 + src/bin/e_main.c | 4 ++-- src/bin/e_startup.c | 19 ++++++++++++++++--- src/bin/e_startup.h | 3 ++- src/modules/wl_desktop_shell/e_mod_main.c | 2 ++ 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/bin/e_comp_x.c b/src/bin/e_comp_x.c index d7a9e11..7556e39 100644 --- a/src/bin/e_comp_x.c +++ b/src/bin/e_comp_x.c @@ -5374,6 +5374,7 @@ _e_comp_x_setup(Ecore_X_Window root, int w, int h) e_comp->pointer->color = ecore_x_cursor_color_supported_get(); e_pointer_type_push(e_comp->pointer, e_comp->pointer, "default"); ecore_x_icccm_state_set(ecore_evas_window_get(e_comp->ee), ECORE_X_WINDOW_STATE_HINT_NORMAL); + e_startup(); } else e_pointer_window_add(e_comp->pointer, e_comp->root); diff --git a/src/bin/e_main.c b/src/bin/e_main.c index 20ee041..2bfe630 100644 --- a/src/bin/e_main.c +++ b/src/bin/e_main.c @@ -1019,9 +1019,9 @@ main(int argc, char **argv) if (!nostartup) { if (after_restart) - e_startup(E_STARTUP_RESTART); + e_startup_mode_set(E_STARTUP_RESTART); else - e_startup(E_STARTUP_START); + e_startup_mode_set(E_STARTUP_START); } TS("Run Startup Apps Done"); diff --git a/src/bin/e_startup.c b/src/bin/e_startup.c index 7a87957..c6b97fb 100644 --- a/src/bin/e_startup.c +++ b/src/bin/e_startup.c @@ -15,9 +15,12 @@ static E_Order *startup_apps = NULL; static int start_app_pos = -1; static Ecore_Event_Handler *desktop_cache_update_handler = NULL; +static Eina_Bool started = EINA_FALSE; + /* externally accessible functions */ + E_API void -e_startup(E_Startup_Mode mode) +e_startup_mode_set(E_Startup_Mode mode) { char buf[PATH_MAX]; @@ -40,6 +43,15 @@ e_startup(E_Startup_Mode mode) e_init_undone(); } +E_API void +e_startup(void) +{ + if (desktop_cache_update_handler) + started = EINA_TRUE; + else + _e_startup(); +} + /* local subsystem functions */ static void _e_startup(void) @@ -104,13 +116,14 @@ _e_startup_event_cb(void *data, int ev_type EINA_UNUSED, void *ev) _e_startup_error_dialog("E: Efreet could not build cache. " "Please check your DBus setup"); } - ecore_event_handler_del(desktop_cache_update_handler); + E_FREE_FUNC(desktop_cache_update_handler, ecore_event_handler_del); buf = data; startup_apps = e_order_new(buf); if (startup_apps) start_app_pos = 0; free(buf); - _e_startup(); + if (started) + _e_startup(); return ECORE_CALLBACK_PASS_ON; } diff --git a/src/bin/e_startup.h b/src/bin/e_startup.h index a902aa9..ed20ce0 100644 --- a/src/bin/e_startup.h +++ b/src/bin/e_startup.h @@ -10,7 +10,8 @@ typedef enum _E_Startup_Mode #ifndef E_STARTUP_H #define E_STARTUP_H -E_API void e_startup(E_Startup_Mode mode); +E_API void e_startup(void); +E_API void e_startup_mode_set(E_Startup_Mode mode); #endif #endif diff --git a/src/modules/wl_desktop_shell/e_mod_main.c b/src/modules/wl_desktop_shell/e_mod_main.c index 873e388..e6140dc 100644 --- a/src/modules/wl_desktop_shell/e_mod_main.c +++ b/src/modules/wl_desktop_shell/e_mod_main.c @@ -1401,6 +1401,8 @@ e_modapi_init(E_Module *m) return NULL; } #endif + e_startup(); + return m; } --