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
This commit is contained in:
Mike Blumenkrantz 2016-04-18 15:27:47 -04:00
parent 40af8d5193
commit 536a3a7ff6
5 changed files with 23 additions and 6 deletions

View File

@ -5460,6 +5460,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);

View File

@ -1039,9 +1039,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");

View File

@ -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;
}

View File

@ -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

View File

@ -1507,6 +1507,8 @@ e_modapi_init(E_Module *m)
return NULL;
}
#endif
e_startup();
return m;
}