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 initialize E_Randr!\n"));
485 _e_main_shutdown_push(e_randr_shutdown);
486 TS("E_Randr Init Done");
491 e_error_message_show(_("Enlightenment cannot set up its environment.\n"));
492 _e_main_shutdown(-1);
494 TS("E_Env Init Done");
495 _e_main_shutdown_push(e_env_shutdown);
497 e_util_env_set("E_ICON_THEME", e_config->icon_theme);
498 ecore_exe_run_priority_set(e_config->priority);
499 locked |= e_config->desklock_start_locked;
501 s = getenv("E_DESKLOCK_LOCKED");
502 if ((s) && (!strcmp(s, "locked"))) waslocked = EINA_TRUE;
504 TS("E_Pointer Init");
505 if (!e_pointer_init())
507 e_error_message_show(_("Enlightenment cannot set up its pointer system.\n"));
508 _e_main_shutdown(-1);
510 TS("E_Pointer Init Done");
511 _e_main_shutdown_push(e_pointer_shutdown);
514 if (!_e_main_path_init())
516 e_error_message_show(_("Enlightenment cannot set up paths for finding files.\n"
517 "Perhaps you are out of memory?"));
518 _e_main_shutdown(-1);
520 TS("E Paths Init Done");
521 _e_main_shutdown_push(_e_main_path_shutdown);
524 if (!e_ipc_init()) _e_main_shutdown(-1);
525 TS("E_Ipc Init Done");
526 _e_main_shutdown_push(e_ipc_shutdown);
528 edje_frametime_set(1.0 / e_config->framerate);
533 e_error_message_show(_("Enlightenment cannot set up its font system.\n"));
534 _e_main_shutdown(-1);
536 TS("E_Font Init Done");
537 _e_main_shutdown_push(e_font_shutdown);
541 TS("E_Font Apply Done");
543 TS("E_Canvas Recache");
545 TS("E_Canvas Recache Done");
550 e_error_message_show(_("Enlightenment cannot set up its theme system.\n"));
551 _e_main_shutdown(-1);
553 TS("E_Theme Init Done");
554 _e_main_shutdown_push(e_theme_shutdown);
556 TS("E_Moveresize Init");
558 TS("E_Moveresize Init Done");
559 _e_main_shutdown_push(e_moveresize_shutdown);
561 if (e_config->show_splash)
562 e_init_status_set(_("Setup Message Bus"));
565 _e_main_shutdown_push(e_msgbus_shutdown);
566 TS("E_Msgbus Init Done");
571 e_error_message_show(_("Enlightenment cannot initialize the FDO desktop system.\n"
572 "Perhaps you lack permissions on ~/.cache/efreet or are\n"
573 "out of memory or disk space?"));
574 _e_main_shutdown(-1);
576 TS("Efreet Init Done");
577 _e_main_shutdown_push(efreet_shutdown);
579 if (e_config->show_splash)
580 e_init_status_set(_("Starting International Support"));
581 TS("E_Intl Post Init");
582 if (!e_intl_post_init())
584 e_error_message_show(_("Enlightenment cannot set up its intl system.\n"));
585 _e_main_shutdown(-1);
587 TS("E_Intl Post Init Done");
588 _e_main_shutdown_push(e_intl_post_shutdown);
590 e_screensaver_preinit();
592 if (e_config->show_splash)
593 e_init_status_set(_("Setup Actions"));
594 TS("E_Actions Init");
595 if (!e_actions_init())
597 e_error_message_show(_("Enlightenment cannot set up its actions system.\n"));
598 _e_main_shutdown(-1);
600 TS("E_Actions Init Done");
601 _e_main_shutdown_push(e_actions_shutdown);
603 /* these just add event handlers and can't fail
604 * timestamping them is dumb.
611 if (e_config->show_splash)
612 e_init_status_set(_("Setup Screens"));
614 if (!_e_main_screens_init())
616 e_error_message_show(_("Enlightenment set up window management for all the screens on your system\n"
617 "failed. Perhaps another window manager is running?\n"));
618 _e_main_shutdown(-1);
620 TS("Screens Init Done");
621 _e_main_shutdown_push(_e_main_screens_shutdown);
627 e_error_message_show(_("Enlightenment cannot set up its scale system.\n"));
628 _e_main_shutdown(-1);
630 TS("E_Scale Init Done");
631 _e_main_shutdown_push(e_scale_shutdown);
633 if (e_config->show_splash)
638 e_error_message_show(_("Enlightenment cannot set up its init screen.\n"));
639 _e_main_shutdown(-1);
641 TS("E_Splash Init Done");
642 _e_main_shutdown_push(e_init_shutdown);
644 if (!((!e_config->show_splash) || (after_restart)))
649 TS("Test File Format Support");
650 _e_main_test_formats();
651 TS("Test File Format Support Done");
655 efreet_icon_extension_add(".svg");
656 efreet_icon_extension_add(".jpg");
657 efreet_icon_extension_add(".png");
658 efreet_icon_extension_add(".edj");
661 if (e_config->show_splash)
662 e_init_status_set(_("Setup ACPI"));
665 TS("E_Acpi Init Done");
666 _e_main_shutdown_push(e_acpi_shutdown);
668 if (e_config->show_splash)
669 e_init_status_set(_("Setup Backlight"));
670 TS("E_Backlight Init");
671 if (!e_backlight_init())
673 e_error_message_show(_("Enlightenment cannot configure the backlight.\n"));
674 _e_main_shutdown(-1);
676 TS("E_Backlight Init Done");
678 if (e_config->show_splash)
679 e_init_status_set(_("Setup Screensaver"));
680 TS("E_Screensaver Init");
681 if (!e_screensaver_init())
683 e_error_message_show(_("Enlightenment cannot configure the X screensaver.\n"));
684 _e_main_shutdown(-1);
686 TS("E_Screensaver Init Done");
687 _e_main_shutdown_push(e_screensaver_shutdown);
689 if (e_config->show_splash)
690 e_init_status_set(_("Setup DPMS"));
694 e_error_message_show(_("Enlightenment cannot configure the DPMS settings.\n"));
695 _e_main_shutdown(-1);
697 TS("E_Dpms Init Done");
698 _e_main_shutdown_push(e_dpms_shutdown);
700 if (e_config->show_splash)
701 e_init_status_set(_("Setup Powersave Modes"));
702 TS("E_Powersave Init");
703 if (!e_powersave_init())
705 e_error_message_show(_("Enlightenment cannot set up its powersave modes.\n"));
706 _e_main_shutdown(-1);
708 TS("E_Powersave Init Done");
709 _e_main_shutdown_push(e_powersave_shutdown);
711 if (e_config->show_splash)
712 e_init_status_set(_("Setup Desklock"));
713 TS("E_Desklock Init");
714 if (!e_desklock_init())
716 e_error_message_show(_("Enlightenment cannot set up its desk locking system.\n"));
717 _e_main_shutdown(-1);
719 TS("E_Desklock Init Done");
720 _e_main_shutdown_push(e_desklock_shutdown);
722 if (waslocked || (locked && ((!after_restart) || (!getenv("E_DESKLOCK_UNLOCKED")))))
723 e_desklock_show(EINA_TRUE);
725 if (e_config->show_splash)
726 e_init_status_set(_("Setup Paths"));
728 _e_main_efreet_paths_init();
729 TS("Efreet Paths Done");
731 if (e_config->show_splash)
732 e_init_status_set(_("Setup System Controls"));
736 e_error_message_show(_("Enlightenment cannot initialize the System Command system.\n"));
737 _e_main_shutdown(-1);
739 TS("E_Sys Init Done");
740 _e_main_shutdown_push(e_sys_shutdown);
742 if (e_config->show_splash)
743 e_init_status_set(_("Setup Execution System"));
747 e_error_message_show(_("Enlightenment cannot set up its exec system.\n"));
748 _e_main_shutdown(-1);
750 TS("E_Exec Init Done");
754 TS("E_Comp Freeze Done");
756 if (e_config->show_splash)
757 e_init_status_set(_("Setup Filemanager"));
761 e_error_message_show(_("Enlightenment cannot initialize the File manager.\n"));
762 _e_main_shutdown(-1);
764 TS("E_Fm2 Init Done");
765 _e_main_shutdown_push(e_fm2_shutdown);
767 if (e_config->show_splash)
768 e_init_status_set(_("Setup Message System"));
772 e_error_message_show(_("Enlightenment cannot set up its msg system.\n"));
773 _e_main_shutdown(-1);
775 TS("E_Msg Init Done");
776 _e_main_shutdown_push(e_msg_shutdown);
778 if (e_config->show_splash)
779 e_init_status_set(_("Setup Grab Input Handling"));
780 TS("E_Grabinput Init");
781 if (!e_grabinput_init())
783 e_error_message_show(_("Enlightenment cannot set up its grab input handling system.\n"));
784 _e_main_shutdown(-1);
786 TS("E_Grabinput Init Done");
787 _e_main_shutdown_push(e_grabinput_shutdown);
789 if (e_config->show_splash)
790 e_init_status_set(_("Setup Modules"));
792 if (!e_module_init())
794 e_error_message_show(_("Enlightenment cannot set up its module system.\n"));
795 _e_main_shutdown(-1);
797 TS("E_Module Init Done");
798 _e_main_shutdown_push(e_module_shutdown);
800 if (e_config->show_splash)
801 e_init_status_set(_("Setup Remembers"));
802 TS("E_Remember Init");
803 if (!e_remember_init(after_restart ? E_STARTUP_RESTART : E_STARTUP_START))
805 e_error_message_show(_("Enlightenment cannot setup remember settings.\n"));
806 _e_main_shutdown(-1);
808 TS("E_Remember Init Done");
809 _e_main_shutdown_push(e_remember_shutdown);
811 if (e_config->show_splash)
812 e_init_status_set(_("Setup Color Classes"));
813 TS("E_Color_Class Init");
814 if (!e_color_class_init())
816 e_error_message_show(_("Enlightenment cannot set up its color class system.\n"));
817 _e_main_shutdown(-1);
819 TS("E_Color_Class Init Done");
820 _e_main_shutdown_push(e_color_class_shutdown);
822 if (e_config->show_splash)
823 e_init_status_set(_("Setup Gadcon"));
825 if (!e_gadcon_init())
827 e_error_message_show(_("Enlightenment cannot set up its gadget control system.\n"));
828 _e_main_shutdown(-1);
830 TS("E_Gadcon Init Done");
831 _e_main_shutdown_push(e_gadcon_shutdown);
833 if (e_config->show_splash)
834 e_init_status_set(_("Setup Toolbars"));
835 TS("E_Toolbar Init");
836 if (!e_toolbar_init())
838 e_error_message_show(_("Enlightenment cannot set up its toolbars.\n"));
839 _e_main_shutdown(-1);
841 TS("E_Toolbar Init Done");
842 _e_main_shutdown_push(e_toolbar_shutdown);
844 if (e_config->show_splash)
845 e_init_status_set(_("Setup Wallpaper"));
849 e_error_message_show(_("Enlightenment cannot set up its desktop background system.\n"));
850 _e_main_shutdown(-1);
852 TS("E_Bg Init Done");
853 _e_main_shutdown_push(e_bg_shutdown);
855 if (e_config->show_splash)
856 e_init_status_set(_("Setup Mouse"));
858 if (!e_mouse_update())
860 e_error_message_show(_("Enlightenment cannot configure the mouse settings.\n"));
861 _e_main_shutdown(-1);
863 TS("E_Mouse Init Done");
865 if (e_config->show_splash)
866 e_init_status_set(_("Setup Bindings"));
867 TS("E_Bindings Init");
868 if (!e_bindings_init())
870 e_error_message_show(_("Enlightenment cannot set up its bindings system.\n"));
871 _e_main_shutdown(-1);
873 TS("E_Bindings Init Done");
874 _e_main_shutdown_push(e_bindings_shutdown);
876 if (e_config->show_splash)
877 e_init_status_set(_("Setup Thumbnailer"));
881 e_error_message_show(_("Enlightenment cannot initialize the Thumbnailing system.\n"));
882 _e_main_shutdown(-1);
884 TS("E_Thumb Init Done");
885 _e_main_shutdown_push(e_thumb_shutdown);
890 e_error_message_show(_("Enlightenment cannot initialize the Icon Cache system.\n"));
891 _e_main_shutdown(-1);
893 TS("E_Icon Init Done");
894 _e_main_shutdown_push(e_icon_shutdown);
897 if (!e_update_init())
899 e_error_message_show(_("Enlightenment cannot initialize the Update system.\n"));
900 _e_main_shutdown(-1);
902 TS("E_Update Init Done");
903 _e_main_shutdown_push(e_update_shutdown);
905 if (e_config->show_splash)
906 e_init_status_set(_("Setup Desktop Environment"));
907 TS("E_Deskenv Init");
908 if (!e_deskenv_init())
910 e_error_message_show(_("Enlightenment cannot initialize its desktop environment.\n"));
911 _e_main_shutdown(-1);
913 TS("E_Deskenv Init Done");
914 _e_main_shutdown_push(e_deskenv_shutdown);
916 if (e_config->show_splash)
917 e_init_status_set(_("Setup File Ordering"));
921 e_error_message_show(_("Enlightenment cannot set up its order file system.\n"));
922 _e_main_shutdown(-1);
924 TS("E_Order Init Done");
925 _e_main_shutdown_push(e_order_shutdown);
927 TS("Add Idler For X Flush");
928 _idle_flush = ecore_idle_enterer_add(_e_main_cb_x_flusher, NULL);
929 TS("Add Idler For X Flush Done");
931 TS("E_Manager Keys Grab");
932 e_managers_keys_grab();
933 TS("E_Manager Keys Grab Done");
935 if (e_config->show_splash)
936 e_init_status_set(_("Load Modules"));
938 _e_main_modules_load(safe_mode);
939 TS("Load Modules Done");
941 TS("Run Startup Apps");
945 e_startup(E_STARTUP_RESTART);
947 e_startup(E_STARTUP_START);
949 TS("Run Startup Apps Done");
951 if (e_config->show_splash && (!after_restart))
952 ecore_timer_add(2.0, _e_main_cb_startup_fake_end, NULL);
956 TS("E_Comp Thaw Done");
962 if (e_config->show_splash)
963 e_init_status_set(_("Setup Shelves"));
967 e_error_message_show(_("Enlightenment cannot set up its module system.\n"));
968 _e_main_shutdown(-1);
970 TS("E_Shelf Init Done");
972 ecore_idle_enterer_before_add(_e_main_shelf_init_job, NULL);
974 _idle_after = ecore_idle_enterer_add(_e_main_cb_idle_after, NULL);
976 if (e_config->show_splash)
977 e_init_status_set(_("Almost Done"));
979 starting = EINA_FALSE;
982 e_util_env_set("E_RESTART", "1");
984 TS("MAIN LOOP AT LAST");
985 if (!setjmp(x_fatal_buff))
986 ecore_main_loop_begin();
988 CRI("FATAL: X Died. Connection gone. Abbreviated Shutdown\n");
991 stopping = EINA_TRUE;
993 if (!x_fatal) e_canvas_idle_flush();
995 e_config_save_flush();
997 e_remember_internal_save();
998 e_comp_internal_save();
1000 _e_main_shutdown(0);
1004 e_util_env_set("E_RESTART_OK", "1");
1005 if (getenv("E_START_MTRACK"))
1006 e_util_env_set("MTRACK", "track");
1007 ecore_app_restart();
1010 e_prefix_shutdown();
1015 /* FIXME: make safe to delete within a callback */
1016 EAPI E_Before_Idler *
1017 e_main_idler_before_add(int (*func)(void *data), void *data, int once)
1021 eb = calloc(1, sizeof(E_Before_Idler));
1025 _idle_before_list = eina_list_append(_idle_before_list, eb);
1030 e_main_idler_before_del(E_Before_Idler *eb)
1036 e_main_ts(const char *str)
1039 t1 = ecore_time_unix_get();
1040 printf("ESTART: %1.5f [%1.5f] - %s\n", t1 - t0, t1 - t2, str);
1046 /* local functions */
1048 _e_main_shutdown(int errcode)
1052 printf("E19: Begin Shutdown Procedure!\n");
1054 if (_idle_before) ecore_idle_enterer_del(_idle_before);
1055 _idle_before = NULL;
1056 if (_idle_after) ecore_idle_enterer_del(_idle_after);
1058 if (_idle_flush) ecore_idle_enterer_del(_idle_flush);
1061 for (i = (_e_main_lvl - 1); i >= 0; i--)
1062 (*_e_main_shutdown_func[i])();
1063 if (errcode < 0) exit(errcode);
1067 _e_main_shutdown_push(int (*func)(void))
1070 if (_e_main_lvl > MAX_LEVEL)
1073 e_error_message_show("WARNING: too many init levels. MAX = %i\n",
1077 _e_main_shutdown_func[_e_main_lvl - 1] = func;
1081 _e_main_parse_arguments(int argc, char **argv)
1086 /* handle some command-line parameters */
1087 for (i = 1; i < argc; i++)
1089 if ((!strcmp(argv[i], "-display")) && (i < (argc - 1)))
1092 e_util_env_set("DISPLAY", argv[i]);
1094 else if ((!strcmp(argv[i], "-fake-xinerama-screen")) && (i < (argc - 1)))
1099 if (sscanf(argv[i], "%ix%i+%i+%i", &w, &h, &x, &y) == 4)
1100 e_xinerama_fake_screen_add(x, y, w, h);
1102 else if (!strcmp(argv[i], "-good"))
1106 printf("LA LA LA\n");
1108 else if (!strcmp(argv[i], "-evil"))
1112 printf("MUHAHAHAHHAHAHAHAHA\n");
1114 else if (!strcmp(argv[i], "-psychotic"))
1118 printf("MUHAHALALALALALALALA\n");
1120 else if ((!strcmp(argv[i], "-profile")) && (i < (argc - 1)))
1123 if (!getenv("E_CONF_PROFILE"))
1124 e_util_env_set("E_CONF_PROFILE", argv[i]);
1126 else if (!strcmp(argv[i], "-i-really-know-what-i-am-doing-and-accept-full-responsibility-for-it"))
1127 really_know = EINA_TRUE;
1128 else if (!strcmp(argv[i], "-locked"))
1130 else if (!strcmp(argv[i], "-nopause"))
1131 e_nopause = EINA_TRUE;
1132 else if ((!strcmp(argv[i], "-h")) ||
1133 (!strcmp(argv[i], "-help")) ||
1134 (!strcmp(argv[i], "--help")))
1139 "\t-display DISPLAY\n"
1140 "\t\tConnect to display named DISPLAY.\n"
1141 "\t\tEG: -display :1.0\n"
1142 "\t-fake-xinerama-screen WxH+X+Y\n"
1143 "\t\tAdd a FAKE xinerama screen (instead of the real ones)\n"
1144 "\t\tgiven the geometry. Add as many as you like. They all\n"
1145 "\t\treplace the real xinerama screens, if any. This can\n"
1146 "\t\tbe used to simulate xinerama.\n"
1147 "\t\tEG: -fake-xinerama-screen 800x600+0+0 -fake-xinerama-screen 800x600+800+0\n"
1148 "\t-profile CONF_PROFILE\n"
1149 "\t\tUse the configuration profile CONF_PROFILE instead of the user selected default or just \"default\".\n"
1155 "\t\tBe psychotic.\n"
1157 "\t\tStart with desklock on, so password will be asked.\n"
1158 "\t-i-really-know-what-i-am-doing-and-accept-full-responsibility-for-it\n"
1159 "\t\tIf you need this help, you don't need this option.\n"
1162 _e_main_shutdown(-1);
1166 /* fix up DISPLAY to be :N.0 if no .screen is in it */
1167 s = getenv("DISPLAY");
1170 char *p, buff[4096];
1172 if (!(p = strrchr(s, ':')))
1174 snprintf(buff, sizeof(buff), "%s:0.0", s);
1175 e_util_env_set("DISPLAY", buff);
1179 if (!strrchr(p, '.'))
1181 snprintf(buff, sizeof(buff), "%s.0", s);
1182 e_util_env_set("DISPLAY", buff);
1187 /* we want to have been launched by enlightenment_start. there is a very */
1188 /* good reason we want to have been launched this way, thus check */
1189 if (!getenv("E_START"))
1191 e_error_message_show(_("You are executing enlightenment directly. This is\n"
1192 "bad. Please do not execute the \"enlightenment\"\n"
1193 "binary. Use the \"enlightenment_start\" launcher. It\n"
1194 "will handle setting up environment variables, paths,\n"
1195 "and launching any other required services etc.\n"
1196 "before enlightenment itself begins running.\n"));
1197 _e_main_shutdown(-1);
1202 _e_main_cb_x_fatal(void *data __UNUSED__)
1204 e_error_message_show("Lost X Connection.\n");
1205 ecore_main_loop_quit();
1208 x_fatal = EINA_TRUE;
1209 if (inloop) longjmp(x_fatal_buff, -99);
1214 _e_main_cb_signal_exit(void *data __UNUSED__, int ev_type __UNUSED__, void *ev __UNUSED__)
1216 /* called on ctrl-c, kill (pid) (also SIGINT, SIGTERM and SIGQIT) */
1217 e_sys_action_do(E_SYS_EXIT, NULL);
1218 return ECORE_CALLBACK_RENEW;
1222 _e_main_cb_signal_hup(void *data __UNUSED__, int ev_type __UNUSED__, void *ev __UNUSED__)
1224 e_sys_action_do(E_SYS_RESTART, NULL);
1225 return ECORE_CALLBACK_RENEW;
1229 _e_main_cb_signal_user(void *data __UNUSED__, int ev_type __UNUSED__, void *ev)
1231 Ecore_Event_Signal_User *e = ev;
1235 // E_Action *a = e_action_find("configuration");
1236 // if ((a) && (a->func.go)) a->func.go(NULL, NULL);
1238 else if (e->number == 2)
1240 // comp module has its own handler for this for enabling/disabling fps debug
1242 return ECORE_CALLBACK_RENEW;
1247 _e_main_dirs_init(void)
1250 const char *dirs[] =
1258 "applications/menu",
1259 "applications/menu/favorite",
1260 "applications/menu/all",
1262 "applications/bar/default",
1263 "applications/startup",
1264 "applications/restart",
1265 "applications/trash",
1266 "applications/desk-lock",
1267 "applications/desk-unlock",
1275 base = e_user_dir_get();
1276 if (ecore_file_mksubdirs(base, dirs) != sizeof(dirs) / sizeof(dirs[0]) - 1)
1278 e_error_message_show("Could not create one of the required "
1279 "subdirectories of '%s'\n", base);
1287 _e_main_dirs_shutdown(void)
1293 _e_main_path_init(void)
1297 /* setup data paths */
1298 path_data = e_path_new();
1301 e_error_message_show("Cannot allocate path for path_data\n");
1304 e_prefix_data_concat_static(buf, "data");
1305 e_path_default_path_append(path_data, buf);
1306 e_path_user_path_set(path_data, &(e_config->path_append_data));
1308 /* setup image paths */
1309 path_images = e_path_new();
1312 e_error_message_show("Cannot allocate path for path_images\n");
1315 e_user_dir_concat_static(buf, "/images");
1316 e_path_default_path_append(path_images, buf);
1317 e_prefix_data_concat_static(buf, "data/images");
1318 e_path_default_path_append(path_images, buf);
1319 e_path_user_path_set(path_images, &(e_config->path_append_images));
1321 /* setup font paths */
1322 path_fonts = e_path_new();
1325 e_error_message_show("Cannot allocate path for path_fonts\n");
1328 e_user_dir_concat_static(buf, "/fonts");
1329 e_path_default_path_append(path_fonts, buf);
1330 e_prefix_data_concat_static(buf, "data/fonts");
1331 e_path_default_path_append(path_fonts, buf);
1332 e_path_user_path_set(path_fonts, &(e_config->path_append_fonts));
1334 /* setup icon paths */
1335 path_icons = e_path_new();
1338 e_error_message_show("Cannot allocate path for path_icons\n");
1341 e_user_dir_concat_static(buf, "/icons");
1342 e_path_default_path_append(path_icons, buf);
1343 e_prefix_data_concat_static(buf, "data/icons");
1344 e_path_default_path_append(path_icons, buf);
1345 e_path_user_path_set(path_icons, &(e_config->path_append_icons));
1347 /* setup module paths */
1348 path_modules = e_path_new();
1351 e_error_message_show("Cannot allocate path for path_modules\n");
1354 e_user_dir_concat_static(buf, "/modules");
1355 e_path_default_path_append(path_modules, buf);
1356 snprintf(buf, sizeof(buf), "%s/enlightenment/modules", e_prefix_lib_get());
1357 e_path_default_path_append(path_modules, buf);
1358 /* FIXME: eventually this has to go - moduels should have installers that
1359 * add appropriate install paths (if not installed to user homedir) to
1360 * e's module search dirs
1362 snprintf(buf, sizeof(buf), "%s/enlightenment/modules_extra", e_prefix_lib_get());
1363 e_path_default_path_append(path_modules, buf);
1364 e_path_user_path_set(path_modules, &(e_config->path_append_modules));
1366 /* setup background paths */
1367 path_backgrounds = e_path_new();
1368 if (!path_backgrounds)
1370 e_error_message_show("Cannot allocate path for path_backgrounds\n");
1373 e_user_dir_concat_static(buf, "/backgrounds");
1374 e_path_default_path_append(path_backgrounds, buf);
1375 e_prefix_data_concat_static(buf, "data/backgrounds");
1376 e_path_default_path_append(path_backgrounds, buf);
1377 e_path_user_path_set(path_backgrounds, &(e_config->path_append_backgrounds));
1379 path_messages = e_path_new();
1382 e_error_message_show("Cannot allocate path for path_messages\n");
1385 e_user_dir_concat_static(buf, "/locale");
1386 e_path_default_path_append(path_messages, buf);
1387 e_path_default_path_append(path_messages, e_prefix_locale_get());
1388 e_path_user_path_set(path_messages, &(e_config->path_append_messages));
1394 _e_main_path_shutdown(void)
1398 e_object_del(E_OBJECT(path_data));
1403 e_object_del(E_OBJECT(path_images));
1408 e_object_del(E_OBJECT(path_fonts));
1413 e_object_del(E_OBJECT(path_icons));
1418 e_object_del(E_OBJECT(path_modules));
1419 path_modules = NULL;
1421 if (path_backgrounds)
1423 e_object_del(E_OBJECT(path_backgrounds));
1424 path_backgrounds = NULL;
1428 e_object_del(E_OBJECT(path_messages));
1429 path_messages = NULL;
1435 _e_main_test_formats(void)
1439 Evas_Object *im, *txt;
1441 char buff[PATH_MAX];
1443 if (e_config->show_splash)
1444 e_init_status_set(_("Testing Format Support"));
1446 if (!(ee = ecore_evas_buffer_new(1, 1)))
1448 e_error_message_show(_("Enlightenment found Evas can't create a buffer canvas. Please check\n"
1449 "Evas has Software Buffer engine support.\n"));
1450 _e_main_shutdown(-1);
1453 evas = ecore_evas_get(ee);
1454 im = evas_object_image_add(evas);
1456 e_prefix_data_concat_static(buff, "data/images/test.svg");
1457 evas_object_image_file_set(im, buff, NULL);
1458 if (evas_object_image_load_error_get(im) != EVAS_LOAD_ERROR_NONE)
1460 e_error_message_show(_("Enlightenment found Evas can't load SVG files. "
1461 "Check Evas has SVG loader support.\n"));
1464 efreet_icon_extension_add(".svg");
1466 e_prefix_data_concat_static(buff, "data/images/test.jpg");
1467 evas_object_image_file_set(im, buff, NULL);
1468 if (evas_object_image_load_error_get(im) != EVAS_LOAD_ERROR_NONE)
1470 e_error_message_show(_("Enlightenment found Evas can't load JPEG files. "
1471 "Check Evas has JPEG loader support.\n"));
1472 _e_main_shutdown(-1);
1474 efreet_icon_extension_add(".jpg");
1476 e_prefix_data_concat_static(buff, "data/images/test.png");
1477 evas_object_image_file_set(im, buff, NULL);
1478 if (evas_object_image_load_error_get(im) != EVAS_LOAD_ERROR_NONE)
1480 e_error_message_show(_("Enlightenment found Evas can't load PNG files. "
1481 "Check Evas has PNG loader support.\n"));
1482 _e_main_shutdown(-1);
1484 efreet_icon_extension_add(".png");
1486 e_prefix_data_concat_static(buff, "data/images/test.edj");
1487 evas_object_image_file_set(im, buff, "images/0");
1488 if (evas_object_image_load_error_get(im) != EVAS_LOAD_ERROR_NONE)
1490 e_error_message_show(_("Enlightenment found Evas can't load EET files. "
1491 "Check Evas has EET loader support.\n"));
1492 _e_main_shutdown(-1);
1494 efreet_icon_extension_add(".edj");
1496 evas_object_del(im);
1498 txt = evas_object_text_add(evas);
1499 evas_object_text_font_set(txt, "Sans", 10);
1500 evas_object_text_text_set(txt, "Hello");
1501 evas_object_geometry_get(txt, NULL, NULL, &tw, &th);
1502 if ((tw <= 0) && (th <= 0))
1504 e_error_message_show(_("Enlightenment found Evas can't load the 'Sans' font. Check Evas has fontconfig\n"
1505 "support and system fontconfig defines a 'Sans' font.\n"));
1506 _e_main_shutdown(-1);
1508 evas_object_del(txt);
1510 ecore_evas_free(ee);
1514 _e_main_screens_init(void)
1516 TS("\tscreens: manager");
1517 if (!e_manager_init()) return 0;
1519 TS("\tscreens: client");
1520 if (!e_client_init()) return 0;
1521 TS("\tscreens: win");
1522 if (!e_win_init()) return 0;
1526 e_error_message_show(_("Enlightenment cannot setup XKB Keyboard layouts.\n"));
1527 _e_main_shutdown(-1);
1529 TS("E_Xkb Init Done");
1531 TS("Compositor Init");
1534 e_error_message_show(_("Enlightenment cannot create a compositor.\n"));
1535 _e_main_shutdown(-1);
1538 _e_main_desk_restore();
1540 if (e_config->show_splash)
1541 e_init_status_set(_("Setup DND"));
1545 e_error_message_show(_("Enlightenment cannot set up its dnd system.\n"));
1546 _e_main_shutdown(-1);
1548 TS("E_Dnd Init Done");
1549 _e_main_shutdown_push(e_dnd_shutdown);
1555 _e_main_screens_shutdown(void)
1561 e_client_shutdown();
1562 e_exehist_shutdown();
1563 e_backlight_shutdown();
1565 // ecore_evas closes evas - deletes objs - deletes fm widgets which tries to
1566 // ipc to slave to stop monitoring - but ipc has been shut down. dont shut
1568 // e_desk_shutdown();
1569 // e_zone_shutdown();
1570 // e_container_shutdown();
1571 // e_manager_shutdown();
1576 _e_main_desk_save(void)
1580 char env[1024], name[1024];
1582 EINA_LIST_FOREACH(e_comp_list(), l, c)
1587 EINA_LIST_FOREACH(c->zones, zl, zone)
1589 snprintf(name, sizeof(name), "DESK_%d_%d", c->num, zone->num);
1590 snprintf(env, sizeof(env), "%d,%d", zone->desk_x_current, zone->desk_y_current);
1591 e_util_env_set(name, env);
1597 _e_main_desk_restore(void)
1600 const Eina_List *l, *ll;
1605 EINA_LIST_FOREACH(e_comp_list(), l, c)
1606 EINA_LIST_FOREACH(c->zones, ll, zone)
1611 snprintf(name, sizeof(name), "DESK_%d_%d", c->num, zone->num);
1614 if (!sscanf(env, "%d,%d", &desk_x, &desk_y)) continue;
1615 desk = e_desk_at_xy_get(zone, desk_x, desk_y);
1616 if (!desk) continue;
1622 _e_main_efreet_paths_init(void)
1626 if ((list = efreet_icon_extra_list_get()))
1628 char buff[PATH_MAX];
1630 e_user_dir_concat_static(buff, "icons");
1631 *list = eina_list_prepend(*list, (void *)eina_stringshare_add(buff));
1632 e_prefix_data_concat_static(buff, "data/icons");
1633 *list = eina_list_prepend(*list, (void *)eina_stringshare_add(buff));
1638 _e_main_modules_load_after(void *d EINA_UNUSED, int type EINA_UNUSED, void *ev EINA_UNUSED)
1640 e_int_config_modules(NULL, NULL);
1641 E_FREE_FUNC(mod_init_end, ecore_event_handler_del);
1642 return ECORE_CALLBACK_RENEW;
1646 _e_main_modules_load(Eina_Bool safe_mode)
1649 e_module_all_load();
1655 crashmodule = getenv("E_MODULE_LOAD");
1656 if (crashmodule) m = e_module_new(crashmodule);
1658 if ((crashmodule) && (m))
1660 e_module_disable(m);
1661 e_object_del(E_OBJECT(m));
1663 e_error_message_show
1664 (_("Enlightenment crashed early on start and has<br>"
1665 "been restarted. There was an error loading the<br>"
1666 "module named: %s. This module has been disabled<br>"
1667 "and will not be loaded."), crashmodule);
1669 (_("Enlightenment crashed early on start and has been restarted"),
1670 _("Enlightenment crashed early on start and has been restarted.<br>"
1671 "There was an error loading the module named: %s<br><br>"
1672 "This module has been disabled and will not be loaded."), crashmodule);
1673 e_module_all_load();
1677 e_error_message_show
1678 (_("Enlightenment crashed early on start and has<br>"
1679 "been restarted. All modules have been disabled<br>"
1680 "and will not be loaded to help remove any problem<br>"
1681 "modules from your configuration. The module<br>"
1682 "configuration dialog should let you select your<br>"
1683 "modules again.\n"));
1685 (_("Enlightenment crashed early on start and has been restarted"),
1686 _("Enlightenment crashed early on start and has been restarted.<br>"
1687 "All modules have been disabled and will not be loaded to help<br>"
1688 "remove any problem modules from your configuration.<br><br>"
1689 "The module configuration dialog should let you select your<br>"
1692 mod_init_end = ecore_event_handler_add(E_EVENT_MODULE_INIT_END, _e_main_modules_load_after, NULL);
1697 _e_main_cb_idle_before(void *data __UNUSED__)
1702 e_menu_idler_before();
1703 e_client_idler_before();
1704 e_pointer_idler_before();
1705 EINA_LIST_FOREACH(_idle_before_list, l, eb)
1709 if (!eb->func(eb->data)) eb->delete_me = 1;
1712 EINA_LIST_FOREACH_SAFE(_idle_before_list, pl, l, eb)
1714 if ((eb->once) || (eb->delete_me))
1717 eina_list_remove_list(_idle_before_list, pl);
1722 return ECORE_CALLBACK_RENEW;
1726 _e_main_cb_idle_after(void *data __UNUSED__)
1728 static int first_idle = 1;
1732 #ifdef E19_RELEASE_BUILD
1737 e_precache_end = EINA_TRUE;
1740 if (first_idle++ < 60)
1744 e_precache_end = EINA_TRUE;
1748 return ECORE_CALLBACK_RENEW;
1752 _e_main_cb_x_flusher(void *data __UNUSED__)
1756 return ECORE_CALLBACK_RENEW;
1760 _e_main_cb_startup_fake_end(void *data __UNUSED__)
1763 return ECORE_CALLBACK_CANCEL;