9 t1 = ecore_time_unix_get(); \
10 printf("ESTART: %1.5f [%1.5f] - %s\n", t1 - t0, t1 - t2, x); \
13 static double t0, t1, t2;
19 * i need to make more use of these when i'm baffled as to when something is
22 * void *(*__malloc_hook)(size_t size, const void *caller);
24 * void *(*__realloc_hook)(void *ptr, size_t size, const void *caller);
26 * void *(*__memalign_hook)(size_t alignment, size_t size,
27 * const void *caller);
29 * void (*__free_hook)(void *ptr, const void *caller);
31 * void (*__malloc_initialize_hook)(void);
33 * void (*__after_morecore_hook)(void);
36 static void my_init_hook(void);
37 static void my_free_hook(void *p, const void *caller);
39 static void (*old_free_hook)(void *ptr, const void *caller) = NULL;
40 void (*__free_hook)(void *ptr, const void *caller);
42 void (*__malloc_initialize_hook) (void) = my_init_hook;
46 old_free_hook = __free_hook;
47 __free_hook = my_free_hook;
50 //void *magicfree = NULL;
53 my_free_hook(void *p, const void *caller)
55 __free_hook = old_free_hook;
56 // if ((p) && (p == magicfree))
58 // printf("CAUGHT!!!!! %p ...\n", p);
62 __free_hook = my_free_hook;
66 /* local function prototypes */
67 static void _e_main_shutdown(int errcode);
68 static void _e_main_shutdown_push(int (*func)(void));
69 static void _e_main_parse_arguments(int argc, char **argv);
70 static Eina_Bool _e_main_cb_signal_exit(void *data __UNUSED__, int ev_type __UNUSED__, void *ev __UNUSED__);
71 static Eina_Bool _e_main_cb_signal_hup(void *data __UNUSED__, int ev_type __UNUSED__, void *ev __UNUSED__);
72 static Eina_Bool _e_main_cb_signal_user(void *data __UNUSED__, int ev_type __UNUSED__, void *ev);
73 static int _e_main_dirs_init(void);
74 static int _e_main_dirs_shutdown(void);
75 static int _e_main_path_init(void);
76 static int _e_main_path_shutdown(void);
77 static void _e_main_test_formats(void);
78 static int _e_main_screens_init(void);
79 static int _e_main_screens_shutdown(void);
80 static void _e_main_desk_save(void);
81 static void _e_main_desk_restore(void);
82 static void _e_main_efreet_paths_init(void);
83 static void _e_main_modules_load(Eina_Bool safe_mode);
84 static Eina_Bool _e_main_cb_x_flusher(void *data __UNUSED__);
85 static Eina_Bool _e_main_cb_idle_before(void *data __UNUSED__);
86 static Eina_Bool _e_main_cb_idle_after(void *data __UNUSED__);
87 static Eina_Bool _e_main_cb_startup_fake_end(void *data __UNUSED__);
90 static Eina_Bool really_know = EINA_FALSE;
91 static Eina_Bool locked = EINA_FALSE;
92 static Eina_Bool inloop = EINA_FALSE;
93 static jmp_buf x_fatal_buff;
95 static int _e_main_lvl = 0;
96 static int(*_e_main_shutdown_func[MAX_LEVEL]) (void);
98 static Eina_List *_idle_before_list = NULL;
99 static Ecore_Idle_Enterer *_idle_before = NULL;
100 static Ecore_Idle_Enterer *_idle_after = NULL;
101 static Ecore_Idle_Enterer *_idle_flush = NULL;
103 static Ecore_Event_Handler *mod_init_end = NULL;
105 /* external variables */
106 EAPI Eina_Bool e_precache_end = EINA_FALSE;
107 EAPI Eina_Bool x_fatal = EINA_FALSE;
108 EAPI Eina_Bool good = EINA_FALSE;
109 EAPI Eina_Bool evil = EINA_FALSE;
110 EAPI Eina_Bool starting = EINA_TRUE;
111 EAPI Eina_Bool stopping = EINA_FALSE;
112 EAPI Eina_Bool restart = EINA_FALSE;
113 EAPI Eina_Bool e_nopause = EINA_FALSE;
114 EINTERN const char *e_first_frame = NULL;
115 EINTERN double e_first_frame_start_time = -1;
118 _xdg_data_dirs_augment(void)
120 const char *s = getenv("XDG_DATA_DIRS");
121 const char *p = e_prefix_get();
122 char newpath[4096], buf[4096];
126 snprintf(newpath, sizeof(newpath), "%s:%s/share", e_prefix_data_get(), p);
129 if (strncmp(s, newpath, strlen(newpath)))
131 snprintf(buf, sizeof(buf), "%s:%s", newpath, s);
132 e_util_env_set("XDG_DATA_DIRS", buf);
137 snprintf(buf, sizeof(buf), "%s:/usr/local/share:/usr/share", newpath);
138 e_util_env_set("XDG_DATA_DIRS", buf);
141 if (!getenv("XDG_RUNTIME_DIR"))
145 snprintf(buf, sizeof(buf), "/tmp/xdg-XXXXXX");
147 if (!dir) dir = "/tmp";
148 e_util_env_set("XDG_RUNTIME_DIR", dir);
153 _e_main_shelf_init_job(void *data EINA_UNUSED)
155 e_shelf_config_update();
156 return ECORE_CALLBACK_CANCEL;
159 /* externally accessible functions */
161 main(int argc, char **argv)
163 Eina_Bool nostartup = EINA_FALSE;
164 Eina_Bool safe_mode = EINA_FALSE;
165 Eina_Bool after_restart = EINA_FALSE;
166 Eina_Bool waslocked = EINA_FALSE;
167 double t = 0.0, tstart = 0.0;
168 char *s = NULL, buff[32];
169 struct sigaction action;
171 t0 = t1 = t2 = ecore_time_unix_get();
175 /* trap deadly bug signals and allow some form of sane recovery */
176 /* or ability to gdb attach and debug at this point - better than your */
177 /* wm/desktop vanishing and not knowing what happened */
178 if (!getenv("NOTIFY_SOCKET"))
181 action.sa_sigaction = e_sigseg_act;
182 action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO;
183 sigemptyset(&action.sa_mask);
184 sigaction(SIGSEGV, &action, NULL);
186 action.sa_sigaction = e_sigill_act;
187 action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO;
188 sigemptyset(&action.sa_mask);
189 sigaction(SIGILL, &action, NULL);
191 action.sa_sigaction = e_sigfpe_act;
192 action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO;
193 sigemptyset(&action.sa_mask);
194 sigaction(SIGFPE, &action, NULL);
196 action.sa_sigaction = e_sigbus_act;
197 action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO;
198 sigemptyset(&action.sa_mask);
199 sigaction(SIGBUS, &action, NULL);
201 action.sa_sigaction = e_sigabrt_act;
202 action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO;
203 sigemptyset(&action.sa_mask);
204 sigaction(SIGABRT, &action, NULL);
205 TS("Signal Trap Done");
208 t = ecore_time_unix_get();
209 s = getenv("E_START_TIME");
210 if ((s) && (!getenv("E_RESTART_OK")))
213 if ((t - tstart) < 5.0) safe_mode = EINA_TRUE;
216 snprintf(buff, sizeof(buff), "%1.1f", tstart);
217 e_util_env_set("E_START_TIME", buff);
219 if (getenv("E_START_MTRACK"))
220 e_util_env_set("MTRACK", NULL);
224 e_error_message_show(_("Enlightenment cannot initialize Eina!\n"));
225 _e_main_shutdown(-1);
227 _e_main_shutdown_push(eina_shutdown);
230 e_error_message_show(_("Enlightenment could not create a logging domain!\n"));
231 _e_main_shutdown(-1);
237 t1 = ecore_time_unix_get(); \
238 printf("ESTART: %1.5f [%1.5f] - %s\n", t1 - t0, t1 - t2, x); \
242 TS("Eina Init Done");
243 _e_main_shutdown_push(e_log_shutdown);
245 TS("Determine Prefix");
246 if (!e_prefix_determine(argv[0]))
249 "ERROR: Enlightenment cannot determine it's installed\n"
250 " prefix from the system or argv[0].\n"
251 " This is because it is not on Linux AND has been\n"
252 " executed strangely. This is unusual.\n");
254 TS("Determine Prefix Done");
256 /* for debugging by redirecting stdout of e to a log file to tail */
257 setvbuf(stdout, NULL, _IONBF, 0);
259 TS("Environment Variables");
260 if (getenv("E_RESTART")) after_restart = EINA_TRUE;
261 if (getenv("DESKTOP_STARTUP_ID"))
262 e_util_env_set("DESKTOP_STARTUP_ID", NULL);
263 e_util_env_set("E_RESTART_OK", NULL);
264 e_util_env_set("PANTS", "ON");
265 e_util_env_set("DESKTOP", "Enlightenment-0.17.0");
266 TS("Environment Variables Done");
268 TS("Parse Arguments");
269 _e_main_parse_arguments(argc, argv);
270 TS("Parse Arguments Done");
272 /*** Initialize Core EFL Libraries We Need ***/
277 e_error_message_show(_("Enlightenment cannot initialize Eet!\n"));
278 _e_main_shutdown(-1);
281 _e_main_shutdown_push(eet_shutdown);
286 e_error_message_show(_("Enlightenment cannot initialize Ecore!\n"));
287 _e_main_shutdown(-1);
289 TS("Ecore Init Done");
290 _e_main_shutdown_push(ecore_shutdown);
292 e_first_frame = getenv("E_FIRST_FRAME");
293 if (e_first_frame && (!e_first_frame[0]))
294 e_first_frame = NULL;
296 e_first_frame_start_time = ecore_time_get();
301 e_error_message_show(_("Enlightenment cannot initialize EIO!\n"));
302 _e_main_shutdown(-1);
305 _e_main_shutdown_push(eio_shutdown);
307 ecore_app_args_set(argc, (const char **)argv);
309 TS("Ecore Event Handlers");
310 if (!ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT,
311 _e_main_cb_signal_exit, NULL))
313 e_error_message_show(_("Enlightenment cannot set up an exit signal handler.\n"
314 "Perhaps you are out of memory?"));
315 _e_main_shutdown(-1);
317 if (!ecore_event_handler_add(ECORE_EVENT_SIGNAL_HUP,
318 _e_main_cb_signal_hup, NULL))
320 e_error_message_show(_("Enlightenment cannot set up a HUP signal handler.\n"
321 "Perhaps you are out of memory?"));
322 _e_main_shutdown(-1);
324 if (!ecore_event_handler_add(ECORE_EVENT_SIGNAL_USER,
325 _e_main_cb_signal_user, NULL))
327 e_error_message_show(_("Enlightenment cannot set up a USER signal handler.\n"
328 "Perhaps you are out of memory?"));
329 _e_main_shutdown(-1);
331 TS("Ecore Event Handlers Done");
333 TS("Ecore_File Init");
334 if (!ecore_file_init())
336 e_error_message_show(_("Enlightenment cannot initialize Ecore_File!\n"));
337 _e_main_shutdown(-1);
339 TS("Ecore_File Init Done");
340 _e_main_shutdown_push(ecore_file_shutdown);
342 TS("Ecore_Con Init");
343 if (!ecore_con_init())
345 e_error_message_show(_("Enlightenment cannot initialize Ecore_Con!\n"));
346 _e_main_shutdown(-1);
348 TS("Ecore_Con Init Done");
349 _e_main_shutdown_push(ecore_con_shutdown);
351 TS("Ecore_Ipc Init");
352 if (!ecore_ipc_init())
354 e_error_message_show(_("Enlightenment cannot initialize Ecore_Ipc!\n"));
355 _e_main_shutdown(-1);
357 TS("Ecore_Ipc Init Done");
358 _e_main_shutdown_push(ecore_ipc_shutdown);
360 _idle_before = ecore_idle_enterer_before_add(_e_main_cb_idle_before, NULL);
362 _xdg_data_dirs_augment();
364 TS("Ecore_Evas Init");
365 if (!ecore_evas_init())
367 e_error_message_show(_("Enlightenment cannot initialize Ecore_Evas!\n"));
368 _e_main_shutdown(-1);
370 TS("Ecore_Evas Init Done");
371 // _e_main_shutdown_push(ecore_evas_shutdown);
373 TS("Elementary Init");
374 if (!elm_init(argc, argv))
376 e_error_message_show(_("Enlightenment cannot initialize Elementary!\n"));
377 _e_main_shutdown(-1);
379 TS("Elementary Init Done");
380 _e_main_shutdown_push(elm_shutdown);
385 e_error_message_show(_("Enlightenment cannot initialize Emotion!\n"));
386 _e_main_shutdown(-1);
388 TS("Emotion Init Done");
389 _e_main_shutdown_push((void *)emotion_shutdown);
391 /* e doesn't sync to compositor - it should be one */
392 ecore_evas_app_comp_sync_set(0);
394 TS("Ecore_Evas Engine Check");
395 if (!ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_SOFTWARE_XCB))
397 if (!ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_SOFTWARE_XLIB))
399 e_error_message_show(_("Enlightenment found ecore_evas doesn't support the Software X11\n"
400 "rendering in Evas. Please check your installation of Evas and\n"
401 "Ecore and check they support the Software X11 rendering engine."));
402 _e_main_shutdown(-1);
405 if (!ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_SOFTWARE_BUFFER))
407 e_error_message_show(_("Enlightenment found ecore_evas doesn't support the Software Buffer\n"
408 "rendering in Evas. Please check your installation of Evas and\n"
409 "Ecore and check they support the Software Buffer rendering engine."));
410 _e_main_shutdown(-1);
412 TS("Ecore_Evas Engine Check Done");
417 e_error_message_show(_("Enlightenment cannot initialize Edje!\n"));
418 _e_main_shutdown(-1);
420 TS("Edje Init Done");
421 _e_main_shutdown_push(edje_shutdown);
424 /*** Initialize E Subsystems We Need ***/
429 e_error_message_show(_("Enlightenment cannot initialize E_Intl!\n"));
430 _e_main_shutdown(-1);
432 TS("E Intl Init Done");
433 _e_main_shutdown_push(e_intl_shutdown);
435 /* init white box of death alert */
439 e_error_message_show(_("Enlightenment cannot initialize its emergency alert system.\n"
440 "Have you set your DISPLAY variable?"));
441 _e_main_shutdown(-1);
443 TS("E_Alert Init Done");
444 _e_main_shutdown_push(e_alert_shutdown);
446 TS("E_Configure Init");
448 TS("E_Configure Init Done");
450 TS("E Directories Init");
451 /* setup directories we will be using for configurations storage etc. */
452 if (!_e_main_dirs_init())
454 e_error_message_show(_("Enlightenment cannot create directories in your home directory.\n"
455 "Perhaps you have no home directory or the disk is full?"));
456 _e_main_shutdown(-1);
458 TS("E Directories Init Done");
459 _e_main_shutdown_push(_e_main_dirs_shutdown);
461 TS("E_Filereg Init");
462 if (!e_filereg_init())
464 e_error_message_show(_("Enlightenment cannot set up its file registry system.\n"));
465 _e_main_shutdown(-1);
467 TS("E_Filereg Init Done");
468 _e_main_shutdown_push(e_filereg_shutdown);
471 if (!e_config_init())
473 e_error_message_show(_("Enlightenment cannot set up its config system.\n"));
474 _e_main_shutdown(-1);
476 TS("E_Config Init Done");
477 _e_main_shutdown_push(e_config_shutdown);
482 e_error_message_show(_("Enlightenment cannot set up its environment.\n"));
483 _e_main_shutdown(-1);
485 TS("E_Env Init Done");
486 _e_main_shutdown_push(e_env_shutdown);
488 e_util_env_set("E_ICON_THEME", e_config->icon_theme);
489 ecore_exe_run_priority_set(e_config->priority);
490 locked |= e_config->desklock_start_locked;
492 s = getenv("E_DESKLOCK_LOCKED");
493 if ((s) && (!strcmp(s, "locked"))) waslocked = EINA_TRUE;
495 TS("E_Pointer Init");
496 if (!e_pointer_init())
498 e_error_message_show(_("Enlightenment cannot set up its pointer system.\n"));
499 _e_main_shutdown(-1);
501 TS("E_Pointer Init Done");
502 _e_main_shutdown_push(e_pointer_shutdown);
505 if (!_e_main_path_init())
507 e_error_message_show(_("Enlightenment cannot set up paths for finding files.\n"
508 "Perhaps you are out of memory?"));
509 _e_main_shutdown(-1);
511 TS("E Paths Init Done");
512 _e_main_shutdown_push(_e_main_path_shutdown);
515 if (!e_ipc_init()) _e_main_shutdown(-1);
516 TS("E_Ipc Init Done");
517 _e_main_shutdown_push(e_ipc_shutdown);
519 edje_frametime_set(1.0 / e_config->framerate);
524 e_error_message_show(_("Enlightenment cannot set up its font system.\n"));
525 _e_main_shutdown(-1);
527 TS("E_Font Init Done");
528 _e_main_shutdown_push(e_font_shutdown);
532 TS("E_Font Apply Done");
534 TS("E_Canvas Recache");
536 TS("E_Canvas Recache Done");
541 e_error_message_show(_("Enlightenment cannot set up its theme system.\n"));
542 _e_main_shutdown(-1);
544 TS("E_Theme Init Done");
545 _e_main_shutdown_push(e_theme_shutdown);
547 TS("E_Moveresize Init");
549 TS("E_Moveresize Init Done");
550 _e_main_shutdown_push(e_moveresize_shutdown);
552 if (e_config->show_splash)
553 e_init_status_set(_("Setup Message Bus"));
556 _e_main_shutdown_push(e_msgbus_shutdown);
557 TS("E_Msgbus Init Done");
562 e_error_message_show(_("Enlightenment cannot initialize the FDO desktop system.\n"
563 "Perhaps you lack permissions on ~/.cache/efreet or are\n"
564 "out of memory or disk space?"));
565 _e_main_shutdown(-1);
567 TS("Efreet Init Done");
568 _e_main_shutdown_push(efreet_shutdown);
570 if (e_config->show_splash)
571 e_init_status_set(_("Starting International Support"));
572 TS("E_Intl Post Init");
573 if (!e_intl_post_init())
575 e_error_message_show(_("Enlightenment cannot set up its intl system.\n"));
576 _e_main_shutdown(-1);
578 TS("E_Intl Post Init Done");
579 _e_main_shutdown_push(e_intl_post_shutdown);
581 e_screensaver_preinit();
583 if (e_config->show_splash)
584 e_init_status_set(_("Setup Actions"));
585 TS("E_Actions Init");
586 if (!e_actions_init())
588 e_error_message_show(_("Enlightenment cannot set up its actions system.\n"));
589 _e_main_shutdown(-1);
591 TS("E_Actions Init Done");
592 _e_main_shutdown_push(e_actions_shutdown);
594 /* these just add event handlers and can't fail
595 * timestamping them is dumb.
603 if (e_config->show_splash)
604 e_init_status_set(_("Setup Screensaver"));
605 TS("E_Screensaver Init");
606 if (!e_screensaver_init())
608 e_error_message_show(_("Enlightenment cannot configure the X screensaver.\n"));
609 _e_main_shutdown(-1);
611 TS("E_Screensaver Init Done");
612 _e_main_shutdown_push(e_screensaver_shutdown);
614 if (e_config->show_splash)
615 e_init_status_set(_("Setup Screens"));
617 if (!_e_main_screens_init())
619 e_error_message_show(_("Enlightenment set up window management for all the screens on your system\n"
620 "failed. Perhaps another window manager is running?\n"));
621 _e_main_shutdown(-1);
623 TS("Screens Init Done");
624 _e_main_shutdown_push(_e_main_screens_shutdown);
630 e_error_message_show(_("Enlightenment cannot set up its scale system.\n"));
631 _e_main_shutdown(-1);
633 TS("E_Scale Init Done");
634 _e_main_shutdown_push(e_scale_shutdown);
636 if (e_config->show_splash)
641 e_error_message_show(_("Enlightenment cannot set up its init screen.\n"));
642 _e_main_shutdown(-1);
644 TS("E_Splash Init Done");
645 _e_main_shutdown_push(e_init_shutdown);
647 if (!((!e_config->show_splash) || (after_restart)))
652 TS("Test File Format Support");
653 _e_main_test_formats();
654 TS("Test File Format Support Done");
658 efreet_icon_extension_add(".svg");
659 efreet_icon_extension_add(".jpg");
660 efreet_icon_extension_add(".png");
661 efreet_icon_extension_add(".edj");
664 if (e_config->show_splash)
665 e_init_status_set(_("Setup ACPI"));
668 TS("E_Acpi Init Done");
669 _e_main_shutdown_push(e_acpi_shutdown);
671 if (e_config->show_splash)
672 e_init_status_set(_("Setup Backlight"));
673 TS("E_Backlight Init");
674 if (!e_backlight_init())
676 e_error_message_show(_("Enlightenment cannot configure the backlight.\n"));
677 _e_main_shutdown(-1);
679 TS("E_Backlight Init Done");
681 if (e_config->show_splash)
682 e_init_status_set(_("Setup DPMS"));
686 e_error_message_show(_("Enlightenment cannot configure the DPMS settings.\n"));
687 _e_main_shutdown(-1);
689 TS("E_Dpms Init Done");
690 _e_main_shutdown_push(e_dpms_shutdown);
692 if (e_config->show_splash)
693 e_init_status_set(_("Setup Powersave Modes"));
694 TS("E_Powersave Init");
695 if (!e_powersave_init())
697 e_error_message_show(_("Enlightenment cannot set up its powersave modes.\n"));
698 _e_main_shutdown(-1);
700 TS("E_Powersave Init Done");
701 _e_main_shutdown_push(e_powersave_shutdown);
703 if (e_config->show_splash)
704 e_init_status_set(_("Setup Desklock"));
705 TS("E_Desklock Init");
706 if (!e_desklock_init())
708 e_error_message_show(_("Enlightenment cannot set up its desk locking system.\n"));
709 _e_main_shutdown(-1);
711 TS("E_Desklock Init Done");
712 _e_main_shutdown_push(e_desklock_shutdown);
714 if (waslocked || (locked && ((!after_restart) || (!getenv("E_DESKLOCK_UNLOCKED")))))
715 e_desklock_show(EINA_TRUE);
717 if (e_config->show_splash)
718 e_init_status_set(_("Setup Paths"));
720 _e_main_efreet_paths_init();
721 TS("Efreet Paths Done");
723 if (e_config->show_splash)
724 e_init_status_set(_("Setup System Controls"));
728 e_error_message_show(_("Enlightenment cannot initialize the System Command system.\n"));
729 _e_main_shutdown(-1);
731 TS("E_Sys Init Done");
732 _e_main_shutdown_push(e_sys_shutdown);
734 if (e_config->show_splash)
735 e_init_status_set(_("Setup Execution System"));
739 e_error_message_show(_("Enlightenment cannot set up its exec system.\n"));
740 _e_main_shutdown(-1);
742 TS("E_Exec Init Done");
746 TS("E_Comp Freeze Done");
748 if (e_config->show_splash)
749 e_init_status_set(_("Setup Filemanager"));
753 e_error_message_show(_("Enlightenment cannot initialize the File manager.\n"));
754 _e_main_shutdown(-1);
756 TS("E_Fm2 Init Done");
757 _e_main_shutdown_push(e_fm2_shutdown);
759 if (e_config->show_splash)
760 e_init_status_set(_("Setup Message System"));
764 e_error_message_show(_("Enlightenment cannot set up its msg system.\n"));
765 _e_main_shutdown(-1);
767 TS("E_Msg Init Done");
768 _e_main_shutdown_push(e_msg_shutdown);
770 if (e_config->show_splash)
771 e_init_status_set(_("Setup Grab Input Handling"));
772 TS("E_Grabinput Init");
773 if (!e_grabinput_init())
775 e_error_message_show(_("Enlightenment cannot set up its grab input handling system.\n"));
776 _e_main_shutdown(-1);
778 TS("E_Grabinput Init Done");
779 _e_main_shutdown_push(e_grabinput_shutdown);
781 if (e_config->show_splash)
782 e_init_status_set(_("Setup Modules"));
784 if (!e_module_init())
786 e_error_message_show(_("Enlightenment cannot set up its module system.\n"));
787 _e_main_shutdown(-1);
789 TS("E_Module Init Done");
790 _e_main_shutdown_push(e_module_shutdown);
792 if (e_config->show_splash)
793 e_init_status_set(_("Setup Remembers"));
794 TS("E_Remember Init");
795 if (!e_remember_init(after_restart ? E_STARTUP_RESTART : E_STARTUP_START))
797 e_error_message_show(_("Enlightenment cannot setup remember settings.\n"));
798 _e_main_shutdown(-1);
800 TS("E_Remember Init Done");
801 _e_main_shutdown_push(e_remember_shutdown);
803 if (e_config->show_splash)
804 e_init_status_set(_("Setup Color Classes"));
805 TS("E_Color_Class Init");
806 if (!e_color_class_init())
808 e_error_message_show(_("Enlightenment cannot set up its color class system.\n"));
809 _e_main_shutdown(-1);
811 TS("E_Color_Class Init Done");
812 _e_main_shutdown_push(e_color_class_shutdown);
814 if (e_config->show_splash)
815 e_init_status_set(_("Setup Gadcon"));
817 if (!e_gadcon_init())
819 e_error_message_show(_("Enlightenment cannot set up its gadget control system.\n"));
820 _e_main_shutdown(-1);
822 TS("E_Gadcon Init Done");
823 _e_main_shutdown_push(e_gadcon_shutdown);
825 if (e_config->show_splash)
826 e_init_status_set(_("Setup Toolbars"));
827 TS("E_Toolbar Init");
828 if (!e_toolbar_init())
830 e_error_message_show(_("Enlightenment cannot set up its toolbars.\n"));
831 _e_main_shutdown(-1);
833 TS("E_Toolbar Init Done");
834 _e_main_shutdown_push(e_toolbar_shutdown);
836 if (e_config->show_splash)
837 e_init_status_set(_("Setup Wallpaper"));
841 e_error_message_show(_("Enlightenment cannot set up its desktop background system.\n"));
842 _e_main_shutdown(-1);
844 TS("E_Bg Init Done");
845 _e_main_shutdown_push(e_bg_shutdown);
847 if (e_config->show_splash)
848 e_init_status_set(_("Setup Mouse"));
850 if (!e_mouse_update())
852 e_error_message_show(_("Enlightenment cannot configure the mouse settings.\n"));
853 _e_main_shutdown(-1);
855 TS("E_Mouse Init Done");
857 if (e_config->show_splash)
858 e_init_status_set(_("Setup Bindings"));
859 TS("E_Bindings Init");
860 if (!e_bindings_init())
862 e_error_message_show(_("Enlightenment cannot set up its bindings system.\n"));
863 _e_main_shutdown(-1);
865 TS("E_Bindings Init Done");
866 _e_main_shutdown_push(e_bindings_shutdown);
868 if (e_config->show_splash)
869 e_init_status_set(_("Setup Thumbnailer"));
873 e_error_message_show(_("Enlightenment cannot initialize the Thumbnailing system.\n"));
874 _e_main_shutdown(-1);
876 TS("E_Thumb Init Done");
877 _e_main_shutdown_push(e_thumb_shutdown);
882 e_error_message_show(_("Enlightenment cannot initialize the Icon Cache system.\n"));
883 _e_main_shutdown(-1);
885 TS("E_Icon Init Done");
886 _e_main_shutdown_push(e_icon_shutdown);
889 if (!e_update_init())
891 e_error_message_show(_("Enlightenment cannot initialize the Update system.\n"));
892 _e_main_shutdown(-1);
894 TS("E_Update Init Done");
895 _e_main_shutdown_push(e_update_shutdown);
897 if (e_config->show_splash)
898 e_init_status_set(_("Setup Desktop Environment"));
899 TS("E_Deskenv Init");
900 if (!e_deskenv_init())
902 e_error_message_show(_("Enlightenment cannot initialize its desktop environment.\n"));
903 _e_main_shutdown(-1);
905 TS("E_Deskenv Init Done");
906 _e_main_shutdown_push(e_deskenv_shutdown);
908 if (e_config->show_splash)
909 e_init_status_set(_("Setup File Ordering"));
913 e_error_message_show(_("Enlightenment cannot set up its order file system.\n"));
914 _e_main_shutdown(-1);
916 TS("E_Order Init Done");
917 _e_main_shutdown_push(e_order_shutdown);
919 TS("Add Idler For X Flush");
920 _idle_flush = ecore_idle_enterer_add(_e_main_cb_x_flusher, NULL);
921 TS("Add Idler For X Flush Done");
923 TS("E_Manager Keys Grab");
924 e_managers_keys_grab();
925 TS("E_Manager Keys Grab Done");
927 if (e_config->show_splash)
928 e_init_status_set(_("Load Modules"));
930 _e_main_modules_load(safe_mode);
931 TS("Load Modules Done");
933 TS("Run Startup Apps");
937 e_startup(E_STARTUP_RESTART);
939 e_startup(E_STARTUP_START);
941 TS("Run Startup Apps Done");
943 if (e_config->show_splash && (!after_restart))
944 ecore_timer_add(2.0, _e_main_cb_startup_fake_end, NULL);
948 TS("E_Comp Thaw Done");
954 if (e_config->show_splash)
955 e_init_status_set(_("Setup Shelves"));
959 e_error_message_show(_("Enlightenment cannot set up its module system.\n"));
960 _e_main_shutdown(-1);
962 TS("E_Shelf Init Done");
964 ecore_idle_enterer_before_add(_e_main_shelf_init_job, NULL);
966 _idle_after = ecore_idle_enterer_add(_e_main_cb_idle_after, NULL);
968 if (e_config->show_splash)
969 e_init_status_set(_("Almost Done"));
971 starting = EINA_FALSE;
974 e_util_env_set("E_RESTART", "1");
976 TS("MAIN LOOP AT LAST");
977 if (!setjmp(x_fatal_buff))
978 ecore_main_loop_begin();
980 CRI("FATAL: X Died. Connection gone. Abbreviated Shutdown\n");
983 stopping = EINA_TRUE;
985 if (!x_fatal) e_canvas_idle_flush();
987 e_config_save_flush();
989 e_remember_internal_save();
990 e_comp_internal_save();
996 e_util_env_set("E_RESTART_OK", "1");
997 if (getenv("E_START_MTRACK"))
998 e_util_env_set("MTRACK", "track");
1002 e_prefix_shutdown();
1007 /* FIXME: make safe to delete within a callback */
1008 EAPI E_Before_Idler *
1009 e_main_idler_before_add(int (*func)(void *data), void *data, int once)
1013 eb = calloc(1, sizeof(E_Before_Idler));
1017 _idle_before_list = eina_list_append(_idle_before_list, eb);
1022 e_main_idler_before_del(E_Before_Idler *eb)
1028 e_main_ts(const char *str)
1031 t1 = ecore_time_unix_get();
1032 printf("ESTART: %1.5f [%1.5f] - %s\n", t1 - t0, t1 - t2, str);
1038 /* local functions */
1040 _e_main_shutdown(int errcode)
1044 printf("E19: Begin Shutdown Procedure!\n");
1046 if (_idle_before) ecore_idle_enterer_del(_idle_before);
1047 _idle_before = NULL;
1048 if (_idle_after) ecore_idle_enterer_del(_idle_after);
1050 if (_idle_flush) ecore_idle_enterer_del(_idle_flush);
1053 for (i = (_e_main_lvl - 1); i >= 0; i--)
1054 (*_e_main_shutdown_func[i])();
1055 if (errcode < 0) exit(errcode);
1059 _e_main_shutdown_push(int (*func)(void))
1062 if (_e_main_lvl > MAX_LEVEL)
1065 e_error_message_show("WARNING: too many init levels. MAX = %i\n",
1069 _e_main_shutdown_func[_e_main_lvl - 1] = func;
1073 _e_main_parse_arguments(int argc, char **argv)
1078 /* handle some command-line parameters */
1079 for (i = 1; i < argc; i++)
1081 if ((!strcmp(argv[i], "-display")) && (i < (argc - 1)))
1084 e_util_env_set("DISPLAY", argv[i]);
1086 else if ((!strcmp(argv[i], "-fake-xinerama-screen")) && (i < (argc - 1)))
1091 if (sscanf(argv[i], "%ix%i+%i+%i", &w, &h, &x, &y) == 4)
1092 e_xinerama_fake_screen_add(x, y, w, h);
1094 else if (!strcmp(argv[i], "-good"))
1098 printf("LA LA LA\n");
1100 else if (!strcmp(argv[i], "-evil"))
1104 printf("MUHAHAHAHHAHAHAHAHA\n");
1106 else if (!strcmp(argv[i], "-psychotic"))
1110 printf("MUHAHALALALALALALALA\n");
1112 else if ((!strcmp(argv[i], "-profile")) && (i < (argc - 1)))
1115 if (!getenv("E_CONF_PROFILE"))
1116 e_util_env_set("E_CONF_PROFILE", argv[i]);
1118 else if (!strcmp(argv[i], "-i-really-know-what-i-am-doing-and-accept-full-responsibility-for-it"))
1119 really_know = EINA_TRUE;
1120 else if (!strcmp(argv[i], "-locked"))
1122 else if (!strcmp(argv[i], "-nopause"))
1123 e_nopause = EINA_TRUE;
1124 else if ((!strcmp(argv[i], "-h")) ||
1125 (!strcmp(argv[i], "-help")) ||
1126 (!strcmp(argv[i], "--help")))
1131 "\t-display DISPLAY\n"
1132 "\t\tConnect to display named DISPLAY.\n"
1133 "\t\tEG: -display :1.0\n"
1134 "\t-fake-xinerama-screen WxH+X+Y\n"
1135 "\t\tAdd a FAKE xinerama screen (instead of the real ones)\n"
1136 "\t\tgiven the geometry. Add as many as you like. They all\n"
1137 "\t\treplace the real xinerama screens, if any. This can\n"
1138 "\t\tbe used to simulate xinerama.\n"
1139 "\t\tEG: -fake-xinerama-screen 800x600+0+0 -fake-xinerama-screen 800x600+800+0\n"
1140 "\t-profile CONF_PROFILE\n"
1141 "\t\tUse the configuration profile CONF_PROFILE instead of the user selected default or just \"default\".\n"
1147 "\t\tBe psychotic.\n"
1149 "\t\tStart with desklock on, so password will be asked.\n"
1150 "\t-i-really-know-what-i-am-doing-and-accept-full-responsibility-for-it\n"
1151 "\t\tIf you need this help, you don't need this option.\n"
1154 _e_main_shutdown(-1);
1158 /* fix up DISPLAY to be :N.0 if no .screen is in it */
1159 s = getenv("DISPLAY");
1162 char *p, buff[4096];
1164 if (!(p = strrchr(s, ':')))
1166 snprintf(buff, sizeof(buff), "%s:0.0", s);
1167 e_util_env_set("DISPLAY", buff);
1171 if (!strrchr(p, '.'))
1173 snprintf(buff, sizeof(buff), "%s.0", s);
1174 e_util_env_set("DISPLAY", buff);
1179 /* we want to have been launched by enlightenment_start. there is a very */
1180 /* good reason we want to have been launched this way, thus check */
1181 if (!getenv("E_START"))
1183 e_error_message_show(_("You are executing enlightenment directly. This is\n"
1184 "bad. Please do not execute the \"enlightenment\"\n"
1185 "binary. Use the \"enlightenment_start\" launcher. It\n"
1186 "will handle setting up environment variables, paths,\n"
1187 "and launching any other required services etc.\n"
1188 "before enlightenment itself begins running.\n"));
1189 _e_main_shutdown(-1);
1194 _e_main_cb_x_fatal(void *data __UNUSED__)
1196 e_error_message_show("Lost X Connection.\n");
1197 ecore_main_loop_quit();
1200 x_fatal = EINA_TRUE;
1201 if (inloop) longjmp(x_fatal_buff, -99);
1206 _e_main_cb_signal_exit(void *data __UNUSED__, int ev_type __UNUSED__, void *ev __UNUSED__)
1208 /* called on ctrl-c, kill (pid) (also SIGINT, SIGTERM and SIGQIT) */
1209 e_sys_action_do(E_SYS_EXIT, NULL);
1210 return ECORE_CALLBACK_RENEW;
1214 _e_main_cb_signal_hup(void *data __UNUSED__, int ev_type __UNUSED__, void *ev __UNUSED__)
1216 e_sys_action_do(E_SYS_RESTART, NULL);
1217 return ECORE_CALLBACK_RENEW;
1221 _e_main_cb_signal_user(void *data __UNUSED__, int ev_type __UNUSED__, void *ev)
1223 Ecore_Event_Signal_User *e = ev;
1227 // E_Action *a = e_action_find("configuration");
1228 // if ((a) && (a->func.go)) a->func.go(NULL, NULL);
1230 else if (e->number == 2)
1232 // comp module has its own handler for this for enabling/disabling fps debug
1234 return ECORE_CALLBACK_RENEW;
1239 _e_main_dirs_init(void)
1242 const char *dirs[] =
1250 "applications/menu",
1251 "applications/menu/favorite",
1252 "applications/menu/all",
1254 "applications/bar/default",
1255 "applications/startup",
1256 "applications/restart",
1257 "applications/trash",
1258 "applications/desk-lock",
1259 "applications/desk-unlock",
1267 base = e_user_dir_get();
1268 if (ecore_file_mksubdirs(base, dirs) != sizeof(dirs) / sizeof(dirs[0]) - 1)
1270 e_error_message_show("Could not create one of the required "
1271 "subdirectories of '%s'\n", base);
1279 _e_main_dirs_shutdown(void)
1285 _e_main_path_init(void)
1289 /* setup data paths */
1290 path_data = e_path_new();
1293 e_error_message_show("Cannot allocate path for path_data\n");
1296 e_prefix_data_concat_static(buf, "data");
1297 e_path_default_path_append(path_data, buf);
1298 e_path_user_path_set(path_data, &(e_config->path_append_data));
1300 /* setup image paths */
1301 path_images = e_path_new();
1304 e_error_message_show("Cannot allocate path for path_images\n");
1307 e_user_dir_concat_static(buf, "/images");
1308 e_path_default_path_append(path_images, buf);
1309 e_prefix_data_concat_static(buf, "data/images");
1310 e_path_default_path_append(path_images, buf);
1311 e_path_user_path_set(path_images, &(e_config->path_append_images));
1313 /* setup font paths */
1314 path_fonts = e_path_new();
1317 e_error_message_show("Cannot allocate path for path_fonts\n");
1320 e_user_dir_concat_static(buf, "/fonts");
1321 e_path_default_path_append(path_fonts, buf);
1322 e_prefix_data_concat_static(buf, "data/fonts");
1323 e_path_default_path_append(path_fonts, buf);
1324 e_path_user_path_set(path_fonts, &(e_config->path_append_fonts));
1326 /* setup icon paths */
1327 path_icons = e_path_new();
1330 e_error_message_show("Cannot allocate path for path_icons\n");
1333 e_user_dir_concat_static(buf, "/icons");
1334 e_path_default_path_append(path_icons, buf);
1335 e_prefix_data_concat_static(buf, "data/icons");
1336 e_path_default_path_append(path_icons, buf);
1337 e_path_user_path_set(path_icons, &(e_config->path_append_icons));
1339 /* setup module paths */
1340 path_modules = e_path_new();
1343 e_error_message_show("Cannot allocate path for path_modules\n");
1346 e_user_dir_concat_static(buf, "/modules");
1347 e_path_default_path_append(path_modules, buf);
1348 snprintf(buf, sizeof(buf), "%s/enlightenment/modules", e_prefix_lib_get());
1349 e_path_default_path_append(path_modules, buf);
1350 /* FIXME: eventually this has to go - moduels should have installers that
1351 * add appropriate install paths (if not installed to user homedir) to
1352 * e's module search dirs
1354 snprintf(buf, sizeof(buf), "%s/enlightenment/modules_extra", e_prefix_lib_get());
1355 e_path_default_path_append(path_modules, buf);
1356 e_path_user_path_set(path_modules, &(e_config->path_append_modules));
1358 /* setup background paths */
1359 path_backgrounds = e_path_new();
1360 if (!path_backgrounds)
1362 e_error_message_show("Cannot allocate path for path_backgrounds\n");
1365 e_user_dir_concat_static(buf, "/backgrounds");
1366 e_path_default_path_append(path_backgrounds, buf);
1367 e_prefix_data_concat_static(buf, "data/backgrounds");
1368 e_path_default_path_append(path_backgrounds, buf);
1369 e_path_user_path_set(path_backgrounds, &(e_config->path_append_backgrounds));
1371 path_messages = e_path_new();
1374 e_error_message_show("Cannot allocate path for path_messages\n");
1377 e_user_dir_concat_static(buf, "/locale");
1378 e_path_default_path_append(path_messages, buf);
1379 e_path_default_path_append(path_messages, e_prefix_locale_get());
1380 e_path_user_path_set(path_messages, &(e_config->path_append_messages));
1386 _e_main_path_shutdown(void)
1390 e_object_del(E_OBJECT(path_data));
1395 e_object_del(E_OBJECT(path_images));
1400 e_object_del(E_OBJECT(path_fonts));
1405 e_object_del(E_OBJECT(path_icons));
1410 e_object_del(E_OBJECT(path_modules));
1411 path_modules = NULL;
1413 if (path_backgrounds)
1415 e_object_del(E_OBJECT(path_backgrounds));
1416 path_backgrounds = NULL;
1420 e_object_del(E_OBJECT(path_messages));
1421 path_messages = NULL;
1427 _e_main_test_formats(void)
1431 Evas_Object *im, *txt;
1433 char buff[PATH_MAX];
1435 if (e_config->show_splash)
1436 e_init_status_set(_("Testing Format Support"));
1438 if (!(ee = ecore_evas_buffer_new(1, 1)))
1440 e_error_message_show(_("Enlightenment found Evas can't create a buffer canvas. Please check\n"
1441 "Evas has Software Buffer engine support.\n"));
1442 _e_main_shutdown(-1);
1445 evas = ecore_evas_get(ee);
1446 im = evas_object_image_add(evas);
1448 e_prefix_data_concat_static(buff, "data/images/test.svg");
1449 evas_object_image_file_set(im, buff, NULL);
1450 if (evas_object_image_load_error_get(im) != EVAS_LOAD_ERROR_NONE)
1452 e_error_message_show(_("Enlightenment found Evas can't load SVG files. "
1453 "Check Evas has SVG loader support.\n"));
1456 efreet_icon_extension_add(".svg");
1458 e_prefix_data_concat_static(buff, "data/images/test.jpg");
1459 evas_object_image_file_set(im, buff, NULL);
1460 if (evas_object_image_load_error_get(im) != EVAS_LOAD_ERROR_NONE)
1462 e_error_message_show(_("Enlightenment found Evas can't load JPEG files. "
1463 "Check Evas has JPEG loader support.\n"));
1464 _e_main_shutdown(-1);
1466 efreet_icon_extension_add(".jpg");
1468 e_prefix_data_concat_static(buff, "data/images/test.png");
1469 evas_object_image_file_set(im, buff, NULL);
1470 if (evas_object_image_load_error_get(im) != EVAS_LOAD_ERROR_NONE)
1472 e_error_message_show(_("Enlightenment found Evas can't load PNG files. "
1473 "Check Evas has PNG loader support.\n"));
1474 _e_main_shutdown(-1);
1476 efreet_icon_extension_add(".png");
1478 e_prefix_data_concat_static(buff, "data/images/test.edj");
1479 evas_object_image_file_set(im, buff, "images/0");
1480 if (evas_object_image_load_error_get(im) != EVAS_LOAD_ERROR_NONE)
1482 e_error_message_show(_("Enlightenment found Evas can't load EET files. "
1483 "Check Evas has EET loader support.\n"));
1484 _e_main_shutdown(-1);
1486 efreet_icon_extension_add(".edj");
1488 evas_object_del(im);
1490 txt = evas_object_text_add(evas);
1491 evas_object_text_font_set(txt, "Sans", 10);
1492 evas_object_text_text_set(txt, "Hello");
1493 evas_object_geometry_get(txt, NULL, NULL, &tw, &th);
1494 if ((tw <= 0) && (th <= 0))
1496 e_error_message_show(_("Enlightenment found Evas can't load the 'Sans' font. Check Evas has fontconfig\n"
1497 "support and system fontconfig defines a 'Sans' font.\n"));
1498 _e_main_shutdown(-1);
1500 evas_object_del(txt);
1502 ecore_evas_free(ee);
1506 _e_main_screens_init(void)
1508 TS("\tscreens: manager");
1509 if (!e_manager_init()) return 0;
1511 TS("\tscreens: client");
1512 if (!e_client_init()) return 0;
1513 TS("\tscreens: win");
1514 if (!e_win_init()) return 0;
1518 e_error_message_show(_("Enlightenment cannot setup XKB Keyboard layouts.\n"));
1519 _e_main_shutdown(-1);
1521 TS("E_Xkb Init Done");
1523 TS("Compositor Init");
1526 e_error_message_show(_("Enlightenment cannot create a compositor.\n"));
1527 _e_main_shutdown(-1);
1530 _e_main_desk_restore();
1532 if (e_config->show_splash)
1533 e_init_status_set(_("Setup DND"));
1537 e_error_message_show(_("Enlightenment cannot set up its dnd system.\n"));
1538 _e_main_shutdown(-1);
1540 TS("E_Dnd Init Done");
1541 _e_main_shutdown_push(e_dnd_shutdown);
1547 _e_main_screens_shutdown(void)
1553 e_client_shutdown();
1554 e_exehist_shutdown();
1555 e_backlight_shutdown();
1557 // ecore_evas closes evas - deletes objs - deletes fm widgets which tries to
1558 // ipc to slave to stop monitoring - but ipc has been shut down. dont shut
1560 // e_desk_shutdown();
1561 // e_zone_shutdown();
1562 // e_container_shutdown();
1563 // e_manager_shutdown();
1568 _e_main_desk_save(void)
1572 char env[1024], name[1024];
1574 EINA_LIST_FOREACH(e_comp_list(), l, c)
1579 EINA_LIST_FOREACH(c->zones, zl, zone)
1581 snprintf(name, sizeof(name), "DESK_%d_%d", c->num, zone->num);
1582 snprintf(env, sizeof(env), "%d,%d", zone->desk_x_current, zone->desk_y_current);
1583 e_util_env_set(name, env);
1589 _e_main_desk_restore(void)
1592 const Eina_List *l, *ll;
1597 EINA_LIST_FOREACH(e_comp_list(), l, c)
1598 EINA_LIST_FOREACH(c->zones, ll, zone)
1603 snprintf(name, sizeof(name), "DESK_%d_%d", c->num, zone->num);
1606 if (!sscanf(env, "%d,%d", &desk_x, &desk_y)) continue;
1607 desk = e_desk_at_xy_get(zone, desk_x, desk_y);
1608 if (!desk) continue;
1614 _e_main_efreet_paths_init(void)
1618 if ((list = efreet_icon_extra_list_get()))
1620 char buff[PATH_MAX];
1622 e_user_dir_concat_static(buff, "icons");
1623 *list = eina_list_prepend(*list, (void *)eina_stringshare_add(buff));
1624 e_prefix_data_concat_static(buff, "data/icons");
1625 *list = eina_list_prepend(*list, (void *)eina_stringshare_add(buff));
1630 _e_main_modules_load_after(void *d EINA_UNUSED, int type EINA_UNUSED, void *ev EINA_UNUSED)
1632 e_int_config_modules(NULL, NULL);
1633 E_FREE_FUNC(mod_init_end, ecore_event_handler_del);
1634 return ECORE_CALLBACK_RENEW;
1638 _e_main_modules_load(Eina_Bool safe_mode)
1641 e_module_all_load();
1647 crashmodule = getenv("E_MODULE_LOAD");
1648 if (crashmodule) m = e_module_new(crashmodule);
1650 if ((crashmodule) && (m))
1652 e_module_disable(m);
1653 e_object_del(E_OBJECT(m));
1655 e_error_message_show
1656 (_("Enlightenment crashed early on start and has<br>"
1657 "been restarted. There was an error loading the<br>"
1658 "module named: %s. This module has been disabled<br>"
1659 "and will not be loaded."), crashmodule);
1661 (_("Enlightenment crashed early on start and has been restarted"),
1662 _("Enlightenment crashed early on start and has been restarted.<br>"
1663 "There was an error loading the module named: %s<br><br>"
1664 "This module has been disabled and will not be loaded."), crashmodule);
1665 e_module_all_load();
1669 e_error_message_show
1670 (_("Enlightenment crashed early on start and has<br>"
1671 "been restarted. All modules have been disabled<br>"
1672 "and will not be loaded to help remove any problem<br>"
1673 "modules from your configuration. The module<br>"
1674 "configuration dialog should let you select your<br>"
1675 "modules again.\n"));
1677 (_("Enlightenment crashed early on start and has been restarted"),
1678 _("Enlightenment crashed early on start and has been restarted.<br>"
1679 "All modules have been disabled and will not be loaded to help<br>"
1680 "remove any problem modules from your configuration.<br><br>"
1681 "The module configuration dialog should let you select your<br>"
1684 mod_init_end = ecore_event_handler_add(E_EVENT_MODULE_INIT_END, _e_main_modules_load_after, NULL);
1689 _e_main_cb_idle_before(void *data __UNUSED__)
1694 e_menu_idler_before();
1695 e_client_idler_before();
1696 e_pointer_idler_before();
1697 EINA_LIST_FOREACH(_idle_before_list, l, eb)
1701 if (!eb->func(eb->data)) eb->delete_me = 1;
1704 EINA_LIST_FOREACH_SAFE(_idle_before_list, pl, l, eb)
1706 if ((eb->once) || (eb->delete_me))
1709 eina_list_remove_list(_idle_before_list, pl);
1714 return ECORE_CALLBACK_RENEW;
1718 _e_main_cb_idle_after(void *data __UNUSED__)
1720 static int first_idle = 1;
1724 #ifdef E19_RELEASE_BUILD
1729 e_precache_end = EINA_TRUE;
1732 if (first_idle++ < 60)
1736 e_precache_end = EINA_TRUE;
1740 return ECORE_CALLBACK_RENEW;
1744 _e_main_cb_x_flusher(void *data __UNUSED__)
1748 return ECORE_CALLBACK_RENEW;
1752 _e_main_cb_startup_fake_end(void *data __UNUSED__)
1755 return ECORE_CALLBACK_CANCEL;