Add missing eina_shutdown to E's main shutdown stack.

Fix formatting.
Remove Whitespace.



SVN revision: 41428
This commit is contained in:
Christopher Michael 2009-07-19 08:59:20 +00:00
parent 43e8b47bb3
commit 69a0f8c84f
1 changed files with 93 additions and 91 deletions

View File

@ -142,16 +142,16 @@ main(int argc, char **argv)
TS("begin"); TS("begin");
#if 0 #if 0
{ {
stack_t ss; stack_t ss;
ss.ss_sp = malloc(8 * 1024); ss.ss_sp = malloc(8 * 1024);
ss.ss_size = 8 * 1024; ss.ss_size = 8 * 1024;
ss.ss_flags = 0; ss.ss_flags = 0;
sigaltstack(&ss, NULL); sigaltstack(&ss, NULL);
} }
#endif #endif
/* trap deadly bug signals and allow some form of sane recovery */ /* trap deadly bug signals and allow some form of sane recovery */
/* or ability to gdb attach and debug at this point - better than your */ /* or ability to gdb attach and debug at this point - better than your */
/* wm/desktop vanishing and not knowing what happened */ /* wm/desktop vanishing and not knowing what happened */
@ -182,22 +182,19 @@ main(int argc, char **argv)
sigaction(SIGABRT, &action, NULL); sigaction(SIGABRT, &action, NULL);
TS("signals done"); TS("signals done");
t = ecore_time_get(); t = ecore_time_get();
s = getenv("E_START_TIME"); s = getenv("E_START_TIME");
if ((s) && (!getenv("E_RESTART_OK"))) if ((s) && (!getenv("E_RESTART_OK")))
{ {
tstart = atof(s); tstart = atof(s);
if ((t - tstart) < 5.0) if ((t - tstart) < 5.0) safe_mode = 1;
{
safe_mode = 1;
}
} }
tstart = t; tstart = t;
snprintf(buf, sizeof(buf), "%1.1f", tstart); snprintf(buf, sizeof(buf), "%1.1f", tstart);
e_util_env_set("E_START_TIME", buf); e_util_env_set("E_START_TIME", buf);
/* FIXME: this is the init code for letting e be relocatable. right now /* FIXME: this is the init code for letting e be relocatable. right now
* its not used - so i want to see if it can reliably determine its exe * its not used - so i want to see if it can reliably determine its exe
* prefix * prefix
@ -244,28 +241,30 @@ main(int argc, char **argv)
} }
} }
TS("prefix done"); TS("prefix done");
/* for debugging by redirecting stdout of e to a log file to tail */ /* for debugging by redirecting stdout of e to a log file to tail */
setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stdout, NULL, _IONBF, 0);
if (getenv("E_RESTART")) after_restart = 1; if (getenv("E_RESTART")) after_restart = 1;
if (getenv("DESKTOP_STARTUP_ID")) e_util_env_set("DESKTOP_STARTUP_ID", NULL); if (getenv("DESKTOP_STARTUP_ID"))
e_util_env_set("DESKTOP_STARTUP_ID", NULL);
e_util_env_set("E_RESTART_OK", NULL); e_util_env_set("E_RESTART_OK", NULL);
e_util_env_set("E_RESTART", "1"); e_util_env_set("E_RESTART", "1");
/* envrionment varabiles so you know E is running/launched you */ /* envrionment varabiles so you know E is running/launched you */
e_util_env_set("PANTS", "ON"); e_util_env_set("PANTS", "ON");
e_util_env_set("DESKTOP", "Enlightenment-0.17.0"); e_util_env_set("DESKTOP", "Enlightenment-0.17.0");
TS("eina init"); TS("eina init");
eina_init(); eina_init();
_e_main_shutdown_push(eina_shutdown);
TS("intl init"); TS("intl init");
e_intl_init(); e_intl_init();
_e_main_shutdown_push(e_intl_shutdown); _e_main_shutdown_push(e_intl_shutdown);
TS("parse args"); TS("parse args");
/* handle some command-line parameters */ /* handle some command-line parameters */
for (i = 1; i < argc; i++) for (i = 1; i < argc; i++)
@ -273,13 +272,12 @@ main(int argc, char **argv)
if ((!strcmp(argv[i], "-display")) && (i < (argc - 1))) if ((!strcmp(argv[i], "-display")) && (i < (argc - 1)))
{ {
i++; i++;
e_util_env_set("DISPLAY", argv[i]); e_util_env_set("DISPLAY", argv[i]);
} }
else if ((!strcmp(argv[i], "-fake-xinerama-screen")) && (i < (argc - 1))) else if ((!strcmp(argv[i], "-fake-xinerama-screen")) && (i < (argc - 1)))
{ {
int x, y, w, h; int x, y, w, h;
i++; i++;
/* WWxHH+XX+YY */ /* WWxHH+XX+YY */
if (sscanf(argv[i], "%ix%i+%i+%i", &w, &h, &x, &y) == 4) if (sscanf(argv[i], "%ix%i+%i+%i", &w, &h, &x, &y) == 4)
@ -356,7 +354,7 @@ main(int argc, char **argv)
if (s) if (s)
{ {
char *p; char *p;
p = strrchr(s, ':'); p = strrchr(s, ':');
if (!p) if (!p)
{ {
@ -378,10 +376,9 @@ main(int argc, char **argv)
/* fixes for FOOLS that keep cp'ing default.edj into ~/.e/e/themes */ /* fixes for FOOLS that keep cp'ing default.edj into ~/.e/e/themes */
{ {
e_user_dir_concat_static(buf, "themes/default.edj"); e_user_dir_concat_static(buf, "themes/default.edj");
if (ecore_file_exists(buf)) if (ecore_file_exists(buf)) ecore_file_unlink(buf);
ecore_file_unlink(buf);
} }
TS("ecore init"); TS("ecore init");
/* basic ecore init */ /* basic ecore init */
if (!ecore_init()) if (!ecore_init())
@ -403,11 +400,11 @@ main(int argc, char **argv)
edje_init(); edje_init();
edje_freeze(); edje_freeze();
_e_main_shutdown_push(edje_shutdown); _e_main_shutdown_push(edje_shutdown);
_e_cacheburst++; _e_cacheburst++;
/* eet_cacheburst(_e_cacheburst); */ /* eet_cacheburst(_e_cacheburst); */
ecore_timer_add(5.0, _e_main_cb_eet_cacheburst_end, NULL); ecore_timer_add(5.0, _e_main_cb_eet_cacheburst_end, NULL);
TS("ecore_file init"); TS("ecore_file init");
/* init the file system */ /* init the file system */
if (!ecore_file_init()) if (!ecore_file_init())
@ -417,10 +414,11 @@ main(int argc, char **argv)
_e_main_shutdown(-1); _e_main_shutdown(-1);
} }
_e_main_shutdown_push(ecore_file_shutdown); _e_main_shutdown_push(ecore_file_shutdown);
TS("more ecore"); TS("more ecore");
/* setup my args */ /* setup my args */
ecore_app_args_set(argc, (const char **)argv); ecore_app_args_set(argc, (const char **)argv);
/* setup a handler for when e is asked to exit via a system signal */ /* setup a handler for when e is asked to exit via a system signal */
if (!ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _e_main_cb_signal_exit, NULL)) if (!ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _e_main_cb_signal_exit, NULL))
{ {
@ -437,7 +435,7 @@ main(int argc, char **argv)
/* an idle enterer to be called before all others */ /* an idle enterer to be called before all others */
_e_main_idle_enterer_before = ecore_idle_enterer_before_add(_e_main_cb_idler_before, NULL); _e_main_idle_enterer_before = ecore_idle_enterer_before_add(_e_main_cb_idler_before, NULL);
TS("x connect"); TS("x connect");
/* init x */ /* init x */
if (!ecore_x_init(NULL)) if (!ecore_x_init(NULL))
@ -466,9 +464,10 @@ main(int argc, char **argv)
"will handle setting up environment variables, paths,\n" "will handle setting up environment variables, paths,\n"
"and launching any other required services etc.\n" "and launching any other required services etc.\n"
"before enlightenment itself begins running.\n"); "before enlightenment itself begins running.\n");
exit(-1); _e_main_shutdown(-1);
// exit(-1);
} }
TS("ecore_con"); TS("ecore_con");
/* init generic communications */ /* init generic communications */
if (!ecore_con_init()) if (!ecore_con_init())
@ -495,16 +494,16 @@ main(int argc, char **argv)
_e_main_shutdown(-1); _e_main_shutdown(-1);
} }
_e_main_shutdown_push(e_xinerama_shutdown); _e_main_shutdown_push(e_xinerama_shutdown);
/* ecore_x_grab(); */ /* ecore_x_grab(); */
ecore_x_io_error_handler_set(_e_main_cb_x_fatal, NULL); ecore_x_io_error_handler_set(_e_main_cb_x_fatal, NULL);
TS("x hints"); TS("x hints");
/* Init window manager hints */ /* Init window manager hints */
e_hints_init(); e_hints_init();
TS("x hints done"); TS("x hints done");
TS("ecore_evas init"); TS("ecore_evas init");
/* init the evas wrapper */ /* init the evas wrapper */
if (!ecore_evas_init()) if (!ecore_evas_init())
@ -532,7 +531,7 @@ main(int argc, char **argv)
// down. // down.
// _e_main_shutdown_push(ecore_evas_shutdown); // _e_main_shutdown_push(ecore_evas_shutdown);
TS("test done"); TS("test done");
/*** Finished loading subsystems, Loading WM Specifics ***/ /*** Finished loading subsystems, Loading WM Specifics ***/
TS("efreet"); TS("efreet");
/* init FDO desktop */ /* init FDO desktop */
@ -551,10 +550,10 @@ main(int argc, char **argv)
} }
_e_main_shutdown_push(efreet_util_shutdown); _e_main_shutdown_push(efreet_util_shutdown);
TS("efreet done"); TS("efreet done");
TS("configure"); TS("configure");
e_configure_init(); e_configure_init();
TS("dirs"); TS("dirs");
/* setup directories we will be using for configurations storage etc. */ /* setup directories we will be using for configurations storage etc. */
if (!_e_main_dirs_init()) if (!_e_main_dirs_init())
@ -564,7 +563,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1); _e_main_shutdown(-1);
} }
_e_main_shutdown_push(_e_main_dirs_shutdown); _e_main_shutdown_push(_e_main_dirs_shutdown);
TS("filereg"); TS("filereg");
/* setup file registry */ /* setup file registry */
if (!e_filereg_init()) if (!e_filereg_init())
@ -573,7 +572,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1); _e_main_shutdown(-1);
} }
_e_main_shutdown_push(e_filereg_shutdown); _e_main_shutdown_push(e_filereg_shutdown);
TS("config"); TS("config");
/* init config system */ /* init config system */
if (!e_config_init()) if (!e_config_init())
@ -587,7 +586,7 @@ main(int argc, char **argv)
/* set all execced stuff to configured priority */ /* set all execced stuff to configured priority */
ecore_exe_run_priority_set(e_config->priority); ecore_exe_run_priority_set(e_config->priority);
TS("scale"); TS("scale");
/* init config system */ /* init config system */
if (!e_scale_init()) if (!e_scale_init())
@ -596,7 +595,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1); _e_main_shutdown(-1);
} }
_e_main_shutdown_push(e_scale_shutdown); _e_main_shutdown_push(e_scale_shutdown);
TS("pointer"); TS("pointer");
if (!e_pointer_init()) if (!e_pointer_init())
{ {
@ -604,7 +603,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1); _e_main_shutdown(-1);
} }
_e_main_shutdown_push(e_pointer_shutdown); _e_main_shutdown_push(e_pointer_shutdown);
TS("path"); TS("path");
/* setup paths for finding things */ /* setup paths for finding things */
if (!_e_main_path_init()) if (!_e_main_path_init())
@ -614,12 +613,12 @@ main(int argc, char **argv)
_e_main_shutdown(-1); _e_main_shutdown(-1);
} }
_e_main_shutdown_push(_e_main_path_shutdown); _e_main_shutdown_push(_e_main_path_shutdown);
TS("ipc"); TS("ipc");
/* setup e ipc service */ /* setup e ipc service */
if (e_ipc_init()) if (e_ipc_init())
_e_main_shutdown_push(e_ipc_shutdown); _e_main_shutdown_push(e_ipc_shutdown);
/* setup edje to animate @ e_config->framerate frames per sec. */ /* setup edje to animate @ e_config->framerate frames per sec. */
edje_frametime_set(1.0 / e_config->framerate); edje_frametime_set(1.0 / e_config->framerate);
@ -652,7 +651,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1); _e_main_shutdown(-1);
} }
_e_main_shutdown_push(e_intl_post_shutdown); _e_main_shutdown_push(e_intl_post_shutdown);
TS("splash"); TS("splash");
if (!((!e_config->show_splash) || (after_restart))) if (!((!e_config->show_splash) || (after_restart)))
{ {
@ -678,7 +677,7 @@ main(int argc, char **argv)
Evas_Object *im, *txt; Evas_Object *im, *txt;
char buf[4096]; char buf[4096];
Evas_Coord tw, th; Evas_Coord tw, th;
ee = ecore_evas_buffer_new(1, 1); ee = ecore_evas_buffer_new(1, 1);
if (!ee) if (!ee)
{ {
@ -688,7 +687,7 @@ main(int argc, char **argv)
} }
e_canvas_add(ee); e_canvas_add(ee);
im = evas_object_image_add(ecore_evas_get(ee)); im = evas_object_image_add(ecore_evas_get(ee));
e_prefix_data_concat_static(buf, "data/images/test.png"); e_prefix_data_concat_static(buf, "data/images/test.png");
evas_object_image_file_set(im, buf, NULL); evas_object_image_file_set(im, buf, NULL);
if (evas_object_image_load_error_get(im) != EVAS_LOAD_ERROR_NONE) if (evas_object_image_load_error_get(im) != EVAS_LOAD_ERROR_NONE)
@ -697,7 +696,7 @@ main(int argc, char **argv)
"loader support.\n")); "loader support.\n"));
_e_main_shutdown(-1); _e_main_shutdown(-1);
} }
e_prefix_data_concat_static(buf, "data/images/test.jpg"); e_prefix_data_concat_static(buf, "data/images/test.jpg");
evas_object_image_file_set(im, buf, NULL); evas_object_image_file_set(im, buf, NULL);
if (evas_object_image_load_error_get(im) != EVAS_LOAD_ERROR_NONE) if (evas_object_image_load_error_get(im) != EVAS_LOAD_ERROR_NONE)
@ -706,7 +705,7 @@ main(int argc, char **argv)
"loader support.\n")); "loader support.\n"));
_e_main_shutdown(-1); _e_main_shutdown(-1);
} }
e_prefix_data_concat_static(buf, "data/images/test.edj"); e_prefix_data_concat_static(buf, "data/images/test.edj");
evas_object_image_file_set(im, buf, "images/0"); evas_object_image_file_set(im, buf, "images/0");
if (evas_object_image_load_error_get(im) != EVAS_LOAD_ERROR_NONE) if (evas_object_image_load_error_get(im) != EVAS_LOAD_ERROR_NONE)
@ -731,7 +730,7 @@ main(int argc, char **argv)
ecore_evas_free(ee); ecore_evas_free(ee);
} }
} }
e_init_status_set(_("Setup Screens")); e_init_status_set(_("Setup Screens"));
TS("screens"); TS("screens");
/* manage the root window */ /* manage the root window */
@ -774,7 +773,7 @@ main(int argc, char **argv)
TS("efreet paths"); TS("efreet paths");
{ {
Eina_List **list; Eina_List **list;
list = efreet_icon_extra_list_get(); list = efreet_icon_extra_list_get();
if (list) if (list)
{ {
@ -796,7 +795,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1); _e_main_shutdown(-1);
} }
_e_main_shutdown_push(e_sys_shutdown); _e_main_shutdown_push(e_sys_shutdown);
e_init_status_set(_("Setup Actions")); e_init_status_set(_("Setup Actions"));
TS("actions"); TS("actions");
/* init actions system */ /* init actions system */
@ -815,6 +814,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1); _e_main_shutdown(-1);
} }
_e_main_shutdown_push(e_exec_shutdown); _e_main_shutdown_push(e_exec_shutdown);
e_init_status_set(_("Setup Remembers")); e_init_status_set(_("Setup Remembers"));
TS("remember"); TS("remember");
/* do remember stuff */ /* do remember stuff */
@ -824,10 +824,10 @@ main(int argc, char **argv)
_e_main_shutdown(-1); _e_main_shutdown(-1);
} }
_e_main_shutdown_push(e_remember_shutdown); _e_main_shutdown_push(e_remember_shutdown);
TS("container freeze"); TS("container freeze");
e_container_all_freeze(); e_container_all_freeze();
e_init_status_set(_("Setup FM")); e_init_status_set(_("Setup FM"));
TS("fm2"); TS("fm2");
/* init the enlightenment file manager */ /* init the enlightenment file manager */
@ -837,7 +837,8 @@ main(int argc, char **argv)
_e_main_shutdown(-1); _e_main_shutdown(-1);
} }
_e_main_shutdown_push(e_fm2_shutdown); _e_main_shutdown_push(e_fm2_shutdown);
/*
/*
TS("fwin"); TS("fwin");
if (!e_fwin_init()) if (!e_fwin_init())
{ {
@ -845,7 +846,8 @@ main(int argc, char **argv)
_e_main_shutdown(-1); _e_main_shutdown(-1);
} }
_e_main_shutdown_push(e_fwin_shutdown); _e_main_shutdown_push(e_fwin_shutdown);
*/ */
e_init_status_set(_("Setup Message System")); e_init_status_set(_("Setup Message System"));
TS("msg"); TS("msg");
/* setup generic msg handling etc */ /* setup generic msg handling etc */
@ -855,6 +857,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1); _e_main_shutdown(-1);
} }
_e_main_shutdown_push(e_msg_shutdown); _e_main_shutdown_push(e_msg_shutdown);
e_init_status_set(_("Setup DND")); e_init_status_set(_("Setup DND"));
TS("dnd"); TS("dnd");
/* setup dnd */ /* setup dnd */
@ -864,6 +867,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1); _e_main_shutdown(-1);
} }
_e_main_shutdown_push(e_dnd_shutdown); _e_main_shutdown_push(e_dnd_shutdown);
e_init_status_set(_("Setup Grab Input Handling")); e_init_status_set(_("Setup Grab Input Handling"));
TS("grabinput"); TS("grabinput");
/* setup input grabbing co-operation system */ /* setup input grabbing co-operation system */
@ -873,6 +877,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1); _e_main_shutdown(-1);
} }
_e_main_shutdown_push(e_grabinput_shutdown); _e_main_shutdown_push(e_grabinput_shutdown);
e_init_status_set(_("Setup Modules")); e_init_status_set(_("Setup Modules"));
TS("modules"); TS("modules");
/* setup module loading etc */ /* setup module loading etc */
@ -882,6 +887,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1); _e_main_shutdown(-1);
} }
_e_main_shutdown_push(e_module_shutdown); _e_main_shutdown_push(e_module_shutdown);
e_init_status_set(_("Setup Color Classes")); e_init_status_set(_("Setup Color Classes"));
TS("colorclasses"); TS("colorclasses");
/* setup color_class */ /* setup color_class */
@ -891,6 +897,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1); _e_main_shutdown(-1);
} }
_e_main_shutdown_push(e_color_class_shutdown); _e_main_shutdown_push(e_color_class_shutdown);
e_init_status_set(_("Setup Gadcon")); e_init_status_set(_("Setup Gadcon"));
TS("gadcon"); TS("gadcon");
/* setup gadcon */ /* setup gadcon */
@ -937,8 +944,8 @@ main(int argc, char **argv)
e_error_message_show(_("Enlightenment cannot configure the mouse settings.")); e_error_message_show(_("Enlightenment cannot configure the mouse settings."));
_e_main_shutdown(-1); _e_main_shutdown(-1);
} }
_e_main_shutdown_push(e_actions_shutdown); _e_main_shutdown_push(e_actions_shutdown);
e_init_status_set(_("Setup Bindings")); e_init_status_set(_("Setup Bindings"));
TS("bindings"); TS("bindings");
/* init bindings system */ /* init bindings system */
@ -948,6 +955,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1); _e_main_shutdown(-1);
} }
_e_main_shutdown_push(e_bindings_shutdown); _e_main_shutdown_push(e_bindings_shutdown);
e_init_status_set(_("Setup Popups")); e_init_status_set(_("Setup Popups"));
TS("popup"); TS("popup");
/* init popup system */ /* init popup system */
@ -989,29 +997,29 @@ main(int argc, char **argv)
TS("add idle enterers"); TS("add idle enterers");
/* add in a handler that just before we go idle we flush x - will happen after ecore_evas's idle rendering as it's after ecore_evas_init() */ /* add in a handler that just before we go idle we flush x - will happen after ecore_evas's idle rendering as it's after ecore_evas_init() */
_e_main_idle_enterer_flusher = ecore_idle_enterer_add(_e_main_cb_x_flusher, NULL); _e_main_idle_enterer_flusher =
ecore_idle_enterer_add(_e_main_cb_x_flusher, NULL);
e_managers_keys_grab(); e_managers_keys_grab();
/* ecore_x_ungrab(); */ /* ecore_x_ungrab(); */
TS("init properites"); TS("init properites");
if (!nostartup) if (!nostartup)
{ {
if (after_restart) e_startup(E_STARTUP_RESTART); if (after_restart) e_startup(E_STARTUP_RESTART);
else e_startup(E_STARTUP_START); else e_startup(E_STARTUP_START);
} }
if (!((!e_config->show_splash) || (after_restart))) if (!((!e_config->show_splash) || (after_restart)))
{ {
ecore_timer_add(16.0, _e_main_cb_startup_fake_end, NULL); ecore_timer_add(16.0, _e_main_cb_startup_fake_end, NULL);
if (locked) if (locked) e_desklock_show();
e_desklock_show();
} }
e_container_all_thaw(); e_container_all_thaw();
TS("test code"); TS("test code");
/* run any testing code now we are set up */ /* run any testing code now we are set up */
e_test(); e_test();
@ -1040,30 +1048,31 @@ main(int argc, char **argv)
"modules again.")); "modules again."));
e_config_save_queue(); e_config_save_queue();
} }
e_init_status_set(_("Configure Shelves")); e_init_status_set(_("Configure Shelves"));
TS("shelf config init"); TS("shelf config init");
e_shelf_config_init(); e_shelf_config_init();
TS("manage all windows"); TS("manage all windows");
_e_main_manage_all(); _e_main_manage_all();
/* an idle enterer to be called after all others */ /* an idle enterer to be called after all others */
_e_main_idle_enterer_after = ecore_idle_enterer_add(_e_main_cb_idler_after, NULL); _e_main_idle_enterer_after =
ecore_idle_enterer_add(_e_main_cb_idler_after, NULL);
e_init_status_set(_("Almost Done")); e_init_status_set(_("Almost Done"));
TS("MAIN LOOP AT LAST"); TS("MAIN LOOP AT LAST");
/* no longer starting up */ /* no longer starting up */
starting = 0; starting = 0;
/* start our main loop */ /* start our main loop */
ecore_timer_add(5.0, stdbg, NULL); ecore_timer_add(5.0, stdbg, NULL);
ecore_main_loop_begin(); ecore_main_loop_begin();
e_canvas_idle_flush(); e_canvas_idle_flush();
stopping = 1; stopping = 1;
/* ask all modules to save their config and then shutdown */ /* ask all modules to save their config and then shutdown */
/* NB: no need to do this as config shutdown will flush any saves */ /* NB: no need to do this as config shutdown will flush any saves */
/* and all changed config was already saved before */ /* and all changed config was already saved before */
@ -1095,7 +1104,7 @@ EAPI E_Before_Idler *
e_main_idler_before_add(int (*func) (void *data), void *data, int once) e_main_idler_before_add(int (*func) (void *data), void *data, int once)
{ {
E_Before_Idler *eb; E_Before_Idler *eb;
eb = calloc(1, sizeof(E_Before_Idler)); eb = calloc(1, sizeof(E_Before_Idler));
eb->func = func; eb->func = func;
eb->data = data; eb->data = data;
@ -1128,7 +1137,7 @@ static void
_e_main_shutdown(int errorcode) _e_main_shutdown(int errorcode)
{ {
int i; int i;
printf("E17: Begin shutdown procedure!\n"); printf("E17: Begin shutdown procedure!\n");
if (_e_main_idle_enterer_before) if (_e_main_idle_enterer_before)
{ {
@ -1156,9 +1165,7 @@ _e_main_x_shutdown(void)
/* ecore_x_ungrab(); */ /* ecore_x_ungrab(); */
ecore_x_focus_reset(); ecore_x_focus_reset();
ecore_x_events_allow_all(); ecore_x_events_allow_all();
ecore_x_shutdown(); ecore_x_shutdown();
return 1; return 1;
} }
@ -1225,7 +1232,7 @@ _e_main_screens_init(void)
if (!e_menu_init()) return 0; if (!e_menu_init()) return 0;
TS("screens: exehist"); TS("screens: exehist");
if (!e_exehist_init()) return 0; if (!e_exehist_init()) return 0;
TS("screens: get roots"); TS("screens: get roots");
num = 0; num = 0;
roots = ecore_x_window_root_list(&num); roots = ecore_x_window_root_list(&num);
@ -1246,7 +1253,7 @@ _e_main_screens_init(void)
{ {
E_Manager *man; E_Manager *man;
E_Container *con; E_Container *con;
man = e_manager_new(roots[i], i); man = e_manager_new(roots[i], i);
if (man) if (man)
e_manager_show(man); e_manager_show(man);
@ -1304,7 +1311,7 @@ static void
_e_main_manage_all(void) _e_main_manage_all(void)
{ {
Eina_List *l; Eina_List *l;
for (l = e_manager_list(); l; l = l->next) for (l = e_manager_list(); l; l = l->next)
e_manager_manage_windows(l->data); e_manager_manage_windows(l->data);
} }
@ -1313,7 +1320,7 @@ static int
_e_main_path_init(void) _e_main_path_init(void)
{ {
char buf[4096]; char buf[4096];
/* setup data paths */ /* setup data paths */
path_data = e_path_new(); path_data = e_path_new();
if (!path_data) if (!path_data)
@ -1336,7 +1343,7 @@ _e_main_path_init(void)
e_prefix_data_concat_static(buf, "data/images"); e_prefix_data_concat_static(buf, "data/images");
e_path_default_path_append(path_images, buf); e_path_default_path_append(path_images, buf);
e_path_user_path_set(path_images, &(e_config->path_append_images)); e_path_user_path_set(path_images, &(e_config->path_append_images));
/* setup font paths */ /* setup font paths */
path_fonts = e_path_new(); path_fonts = e_path_new();
if (!path_fonts) if (!path_fonts)
@ -1412,7 +1419,7 @@ _e_main_path_init(void)
e_path_default_path_append(path_messages, "~/.e/e/locale"); e_path_default_path_append(path_messages, "~/.e/e/locale");
e_path_default_path_append(path_messages, e_prefix_locale_get()); e_path_default_path_append(path_messages, e_prefix_locale_get());
e_path_user_path_set(path_messages, &(e_config->path_append_messages)); e_path_user_path_set(path_messages, &(e_config->path_append_messages));
return 1; return 1;
} }
@ -1496,7 +1503,7 @@ static int
_e_main_cb_idler_before(void *data __UNUSED__) _e_main_cb_idler_before(void *data __UNUSED__)
{ {
Eina_List *l, *pl; Eina_List *l, *pl;
e_menu_idler_before(); e_menu_idler_before();
e_focus_idler_before(); e_focus_idler_before();
e_border_idler_before(); e_border_idler_before();
@ -1506,7 +1513,7 @@ _e_main_cb_idler_before(void *data __UNUSED__)
for (l = _e_main_idler_before_list; l; l = l->next) for (l = _e_main_idler_before_list; l; l = l->next)
{ {
E_Before_Idler *eb; E_Before_Idler *eb;
eb = l->data; eb = l->data;
if (!eb->delete_me) if (!eb->delete_me)
{ {
@ -1516,7 +1523,7 @@ _e_main_cb_idler_before(void *data __UNUSED__)
for (l = _e_main_idler_before_list; l;) for (l = _e_main_idler_before_list; l;)
{ {
E_Before_Idler *eb; E_Before_Idler *eb;
eb = l->data; eb = l->data;
pl = l; pl = l;
l = l->next; l = l->next;
@ -1541,7 +1548,7 @@ _e_main_cb_idler_after(void *data __UNUSED__)
/* eet_cacheburst(_e_cacheburst); */ /* eet_cacheburst(_e_cacheburst); */
{ {
static int first_idle = 1; static int first_idle = 1;
if (first_idle) if (first_idle)
{ {
TS("SLEEP"); TS("SLEEP");
@ -1571,8 +1578,7 @@ static void
_e_main_desk_save(void) _e_main_desk_save(void)
{ {
Eina_List *ml; Eina_List *ml;
char env[1024]; char env[1024], name[1024];
char name[1024];
for (ml = e_manager_list(); ml; ml = ml->next) for (ml = e_manager_list(); ml; ml = ml->next)
{ {
@ -1580,20 +1586,17 @@ _e_main_desk_save(void)
Eina_List *cl; Eina_List *cl;
man = ml->data; man = ml->data;
for (cl = man->containers; cl; cl = cl->next) for (cl = man->containers; cl; cl = cl->next)
{ {
E_Container *con; E_Container *con;
Eina_List *zl; Eina_List *zl;
con = cl->data; con = cl->data;
for (zl = con->zones; zl; zl = zl->next) for (zl = con->zones; zl; zl = zl->next)
{ {
E_Zone *zone; E_Zone *zone;
zone = zl->data; zone = zl->data;
snprintf(name, sizeof(name), "DESK_%d_%d_%d", man->num, con->num, zone->num); snprintf(name, sizeof(name), "DESK_%d_%d_%d", man->num, con->num, zone->num);
snprintf(env, sizeof(env), "%d,%d", zone->desk_x_current, zone->desk_y_current); snprintf(env, sizeof(env), "%d,%d", zone->desk_x_current, zone->desk_y_current);
e_util_env_set(name, env); e_util_env_set(name, env);
@ -1616,7 +1619,6 @@ _e_main_desk_restore(E_Manager *man, E_Container *con)
int desk_x, desk_y; int desk_x, desk_y;
zone = zl->data; zone = zl->data;
snprintf(name, sizeof(name), "DESK_%d_%d_%d", man->num, con->num, zone->num); snprintf(name, sizeof(name), "DESK_%d_%d_%d", man->num, con->num, zone->num);
env = getenv(name); env = getenv(name);
if (!env) continue; if (!env) continue;