move init splash to its own process to make it smoother and able to be up


			
			
				devs/princeamd/enlightenment-0.17-elive
			
			
		
Carsten Haitzler 16 years ago
parent 81440c9066
commit a6825b262b
  1. 15
      src/bin/Makefile.am
  2. 7
      src/bin/e_border.c
  3. 5
      src/bin/e_container.c
  4. 233
      src/bin/e_init.c
  5. 6
      src/bin/e_init.h
  6. 488
      src/bin/e_init_main.c
  7. 4
      src/bin/e_ipc.c
  8. 1
      src/bin/e_ipc.h
  9. 217
      src/bin/e_main.c
  10. 41
      src/bin/e_manager.c
  11. 1
      src/bin/e_manager.h
  12. 2
      src/bin/e_start_main.c
  13. 4
      src/bin/e_startup.c

@ -20,7 +20,8 @@ enlightenment_imc \
enlightenment_start \
enlightenment_thumb \
enlightenment_sys \
enlightenment_fm
enlightenment_fm \
enlightenment_init
ENLIGHTENMENTHEADERS = \
e.h \
@ -290,7 +291,7 @@ e.h \
e_ipc_codec.c \
e_remote_main.c
enlightenment_remote_LDFLAGS = @e_libs@ @dlopen_libs@
enlightenment_remote_LDFLAGS = @e_libs@
enlightenment_imc_SOURCES = \
e.h \
@ -309,7 +310,7 @@ e_thumb_main.c \
e_user.c \
e_sha1.c
enlightenment_thumb_LDFLAGS = @e_libs@ @dlopen_libs@
enlightenment_thumb_LDFLAGS = @e_libs@
enlightenment_fm_SOURCES = \
e_fm_main.c \
@ -322,7 +323,13 @@ enlightenment_fm_CFLAGS = $(INCLUDES) @E_DBUS_CFLAGS@ @E_HAL_CFLAGS@
enlightenment_sys_SOURCES = \
e_sys_main.c
enlightenment_sys_LDFLAGS = @e_libs@ @dlopen_libs@
enlightenment_sys_LDFLAGS = @e_libs@
enlightenment_init_SOURCES = \
e_init_main.c \
e_xinerama.c
enlightenment_init_LDFLAGS = @e_libs@
setuid_root_mode = a=rx,u+xs
install-exec-hook:

@ -197,6 +197,8 @@ e_border_init(void)
E_EVENT_BORDER_FOCUS_OUT = ecore_event_type_new();
E_EVENT_BORDER_PROPERTY = ecore_event_type_new();
e_init_undone();
return 1;
}
@ -4317,6 +4319,7 @@ _e_border_cb_efreet_desktop_list_change(void *data, int ev_type, void *ev)
{
Evas_List *l;
printf("EFREET DESKTOP LIST CHANGE\n");
/* mark all borders for desktop/icon updates */
for (l = borders; l; l = l->next)
{
@ -4329,6 +4332,8 @@ _e_border_cb_efreet_desktop_list_change(void *data, int ev_type, void *ev)
bd->changed = 1;
}
}
e_init_status_set(_("Desktop files scan done"));
e_init_done();
return 1;
}
@ -4339,6 +4344,8 @@ _e_border_cb_efreet_desktop_change(void *data, int ev_type, void *ev)
Evas_List *l;
event = ev;
printf("EFREET DESKTOP DESKTOP CHANGE\n");
e_init_status_set(_("Desktop file scan"));
switch (event->change)
{
case EFREET_DESKTOP_CHANGE_ADD:

@ -135,9 +135,8 @@ e_container_new(E_Manager *man)
}
/* Put init win on top */
mwin = e_init_window_get();
if (mwin)
ecore_x_window_configure(mwin,
if (man->initwin)
ecore_x_window_configure(man->initwin,
ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING |
ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
0, 0, 0, 0, 0,

@ -3,6 +3,238 @@
*/
#include "e.h"
#if 1
static const char *title = NULL;
static const char *version = NULL;
static Ecore_Exe *init_exe = NULL;
static Ecore_Event_Handler *exe_del_handler = NULL;
static Ecore_Ipc_Client *client = NULL;
static int done = 0;
static int undone = 0;
static int
_e_init_cb_exe_event_del(void *data, int type, void *event)
{
Ecore_Exe_Event_Del *ev;
Evas_List *l;
ev = event;
if (ev->exe == init_exe)
{
/* init exited */
// ecore_exe_free(init_exe);
init_exe = NULL;
}
return 1;
}
EAPI int
e_init_init(void)
{
exe_del_handler = ecore_event_handler_add(ECORE_EXE_EVENT_DEL,
_e_init_cb_exe_event_del,
NULL);
client = NULL;
done = 0;
return 1;
}
EAPI int
e_init_shutdown(void)
{
/* if not killed, kill init */
e_init_hide();
if (title) evas_stringshare_del(title);
if (version) evas_stringshare_del(version);
title = NULL;
version = NULL;
ecore_event_handler_del(exe_del_handler);
exe_del_handler = NULL;
return 1;
}
EAPI void
e_init_show(void)
{
char buf[8192], *theme, *tit, *ver;
const char *s = NULL;
/* exec init */
if (!e_config->init_default_theme)
s = e_path_find(path_init, "default.edj");
else if (e_config->init_default_theme[0] == '/')
s = evas_stringshare_add(e_config->init_default_theme);
else
s = e_path_find(path_init, e_config->init_default_theme);
if (s) theme = strdup(e_util_filename_escape(s));
else theme = strdup("XdX");
if (s) evas_stringshare_del(s);
if (title) tit = strdup(e_util_filename_escape(title));
else tit = strdup("XtX");
if (version) ver = strdup(e_util_filename_escape(version));
else ver = strdup("XvX");
snprintf(buf, sizeof(buf), "%s/enlightenment_init %s %i %i %s %s",
e_prefix_bin_get(),
theme,
e_canvas_engine_decide(e_config->evas_engine_init),
e_config->font_hinting,
tit, ver);
free(theme);
free(tit);
free(ver);
/* FIXME: add font path to cmd-line */
init_exe = ecore_exe_run(buf, NULL);
}
EAPI void
e_init_hide(void)
{
if (init_exe) ecore_exe_terminate(init_exe);
}
EAPI void
e_init_title_set(const char *str)
{
if (title) evas_stringshare_del(title);
title = evas_stringshare_add(str);
}
EAPI void
e_init_version_set(const char *str)
{
if (version) evas_stringshare_del(version);
version = evas_stringshare_add(str);
}
EAPI void
e_init_status_set(const char *str)
{
printf("---STAT %p %s\n", client, str);
if (!client) return;
ecore_ipc_client_send(client, E_IPC_DOMAIN_INIT, 1, 0, 0, 0, str, strlen(str) + 1);
ecore_ipc_client_flush(client);
}
EAPI void
e_init_done(void)
{
undone--;
if (undone > 0) return;
done = 1;
printf("---DONE %p\n", client);
if (!client) return;
ecore_ipc_client_send(client, E_IPC_DOMAIN_INIT, 2, 0, 0, 0, NULL, 0);
ecore_ipc_client_flush(client);
}
EAPI void
e_init_undone(void)
{
undone++;
}
EAPI void
e_init_client_data(Ecore_Ipc_Event_Client_Data *e)
{
printf("---new init client\n");
if (!client) client = e->client;
if (e->minor == 1)
{
if (e->data)
{
int i, num;
Ecore_X_Window *initwins;
num = e->size / sizeof(Ecore_X_Window);
initwins = e->data;
for (i = 0; i < num; i+= 2)
{
Evas_List *l;
for (l = e_manager_list(); l; l = l->next)
{
E_Manager *man;
man = l->data;
if (man->root == initwins[i + 0])
{
man->initwin = initwins[i + 1];
ecore_x_window_raise(man->initwin);
}
}
}
}
}
else if (e->minor == 2)
{
e_config->show_splash = e->ref;
e_config_save_queue();
}
if (done) e_init_done();
}
EAPI void
e_init_client_del(Ecore_Ipc_Event_Client_Del *e)
{
printf("---del init client\n");
if (e->client == client)
{
Evas_List *l;
client = NULL;
for (l = e_manager_list(); l; l = l->next)
{
E_Manager *man;
man = l->data;
man->initwin = 0;
}
}
}
#else /* OLD INIT CODE */
static void _e_init_icons_del(void);
static void _e_init_cb_signal_disable(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _e_init_cb_signal_enable(void *data, Evas_Object *obj, const char *emission, const char *source);
@ -314,3 +546,4 @@ _e_init_cb_timeout(void *data)
"one you use."));
return 0;
}
#endif

@ -13,10 +13,10 @@ EAPI void e_init_hide(void);
EAPI void e_init_title_set(const char *str);
EAPI void e_init_version_set(const char *str);
EAPI void e_init_status_set(const char *str);
EAPI Ecore_X_Window e_init_window_get(void);
EAPI void e_init_done(void);
EAPI void e_init_undone(void);
EAPI void e_init_client_data(Ecore_Ipc_Event_Client_Data *e);
EAPI void e_init_client_del(Ecore_Ipc_Event_Client_Del *e);
EAPI void e_init_icons_desktop_add(Efreet_Desktop *desktop);
#endif
#endif

@ -0,0 +1,488 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <Ecore.h>
#include <Ecore_X.h>
#include <Ecore_Evas.h>
#include <Ecore_Ipc.h>
#include <Ecore_File.h>
#include <Evas.h>
#include <Eet.h>
#include <Edje.h>
#define E_TYPEDEFS 1
#include "e_xinerama.h"
#undef E_TYPEDEFS
#include "e_xinerama.h"
EAPI int e_init_init(void);
EAPI int e_init_shutdown(void);
EAPI void e_init_show(void);
EAPI void e_init_hide(void);
EAPI void e_init_title_set(const char *str);
EAPI void e_init_version_set(const char *str);
EAPI void e_init_status_set(const char *str);
EAPI void e_init_done(void);
/* local subsystem functions */
static int _e_ipc_init(void);
static int _e_ipc_cb_server_add(void *data, int type, void *event);
static int _e_ipc_cb_server_del(void *data, int type, void *event);
static int _e_ipc_cb_server_data(void *data, int type, void *event);
/* local subsystem globals */
static Ecore_Ipc_Server *_e_ipc_server = NULL;
static const char *theme = NULL;
static int font_hinting = -1;
static int engine = -1;
static const char *title = NULL;
static const char *verstr = NULL;
static Evas_List *fpath = NULL;
static Ecore_X_Window *initwins = NULL;
static int initwins_num = 0;
static Ecore_Ipc_Server *server = NULL;
int
main(int argc, char **argv)
{
int i;
for (i = 1; i < argc; i++)
{
if ((i == 1) &&
((!strcmp(argv[i], "-h")) ||
(!strcmp(argv[i], "-help")) ||
(!strcmp(argv[i], "--help"))))
{
printf(
"This is an internal tool for Enlightenment.\n"
"do not use it.\n"
);
exit(0);
}
else if (!theme) theme = argv[i];
else if (engine < 0) engine = atoi(argv[i]);
else if (font_hinting < 0) font_hinting = atoi(argv[i]);
else if (!title) title = argv[i];
else if (!verstr) verstr = argv[i];
else fpath = evas_list_append(fpath, argv[i]);
}
ecore_init();
ecore_x_init(NULL);
ecore_app_args_set(argc, (const char **)argv);
eet_init();
evas_init();
ecore_evas_init();
edje_init();
ecore_file_init();
ecore_ipc_init();
if (_e_ipc_init())
{
e_init_init();
e_init_show();
e_init_title_set(title);
e_init_version_set(verstr);
e_init_status_set("");
ecore_main_loop_begin();
}
if (_e_ipc_server)
{
ecore_ipc_server_del(_e_ipc_server);
_e_ipc_server = NULL;
}
ecore_ipc_shutdown();
ecore_file_shutdown();
ecore_evas_shutdown();
edje_shutdown();
evas_shutdown();
eet_shutdown();
ecore_x_shutdown();
ecore_shutdown();
return 0;
}
/* local subsystem functions */
static int
_e_ipc_init(void)
{
char *sdir;
sdir = getenv("E_IPC_SOCKET");
if (!sdir)
{
printf("The E_IPC_SOCKET environment variable is not set. This is\n"
"exported by Enlightenment to all processes it launches.\n"
"This environment variable must be set and must point to\n"
"Enlightenment's IPC socket file (minus port number).\n");
return 0;
}
_e_ipc_server = ecore_ipc_server_connect(ECORE_IPC_LOCAL_SYSTEM, sdir, 0, NULL);
if (!_e_ipc_server) return 0;
ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_ADD, _e_ipc_cb_server_add, NULL);
ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DEL, _e_ipc_cb_server_del, NULL);
ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DATA, _e_ipc_cb_server_data, NULL);
return 1;
}
static int
_e_ipc_cb_server_add(void *data, int type, void *event)
{
Ecore_Ipc_Event_Server_Add *e;
e = event;
server = e->server;
ecore_ipc_server_send(server,
7/*E_IPC_DOMAIN_INIT*/,
1/*hello*/,
0, 0, 0,
initwins, initwins_num * sizeof(Ecore_X_Window));
ecore_ipc_server_flush(server);
return 1;
}
static int
_e_ipc_cb_server_del(void *data, int type, void *event)
{
Ecore_Ipc_Event_Server_Del *e;
e = event;
/* quit now */
ecore_main_loop_quit();
return 1;
}
static int
_e_ipc_cb_server_data(void *data, int type, void *event)
{
Ecore_Ipc_Event_Server_Data *e;
e = event;
if (e->major != 7/*E_IPC_DOMAIN_INIT*/) return 1;
switch (e->minor)
{
case 1:
if (e->data) e_init_status_set(e->data);
break;
case 2:
/* quit now */
e_init_done();
break;
default:
break;
}
return 1;
}
static void _e_init_cb_signal_disable(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _e_init_cb_signal_enable(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _e_init_cb_signal_done_ok(void *data, Evas_Object *obj, const char *emission, const char *source);
static int _e_init_cb_window_configure(void *data, int ev_type, void *ev);
static int _e_init_cb_timeout(void *data);
static Ecore_Evas *_e_init_evas_new(Ecore_X_Window root, int w, int h, Ecore_X_Window *winret);
/* local subsystem globals */
static Ecore_X_Window _e_init_root_win = 0;
static Ecore_X_Window _e_init_win = 0;
static Ecore_Evas *_e_init_ecore_evas = NULL;
static Evas *_e_init_evas = NULL;
static Evas_Object *_e_init_object = NULL;
static Ecore_Event_Handler *_e_init_configure_handler = NULL;
static Ecore_Timer *_e_init_timeout_timer = NULL;
/* externally accessible functions */
EAPI int
e_init_init(void)
{
int w, h;
Ecore_X_Window root;
Ecore_X_Window *roots;
int i, num;
Evas_Object *o;
Evas_List *l, *screens;
const char *s;
e_xinerama_init();
_e_init_configure_handler =
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CONFIGURE,
_e_init_cb_window_configure, NULL);
num = 0;
roots = ecore_x_window_root_list(&num);
if ((!roots) || (num <= 0))
{
return 0;
}
root = roots[0];
_e_init_root_win = root;
s = theme;
initwins = malloc(num * 2 * sizeof(Ecore_X_Window));
initwins_num = num * 2;
/* extra root windows/screens */
for (i = 1; i < num; i++)
{
ecore_x_window_size_get(roots[i], &w, &h);
_e_init_ecore_evas = _e_init_evas_new(roots[i], w, h,
&_e_init_win);
_e_init_evas = ecore_evas_get(_e_init_ecore_evas);
initwins[(i * 2) + 0] = roots[i];
initwins[(i * 2) + 1] = _e_init_win;
o = edje_object_add(_e_init_evas);
edje_object_file_set(o, s, "e/init/extra_screen");
evas_object_move(o, 0, 0);
evas_object_resize(o, w, h);
evas_object_show(o);
}
/* primary screen/root */
ecore_x_window_size_get(root, &w, &h);
_e_init_ecore_evas = _e_init_evas_new(root, w, h, &_e_init_win);
_e_init_evas = ecore_evas_get(_e_init_ecore_evas);
initwins[0] = root;
initwins[1] = _e_init_win;
/* look at xinerama asto how to slice this up */
screens = (Evas_List *)e_xinerama_screens_get();
if (screens)
{
for (l = screens; l; l = l->next)
{
E_Screen *scr;
scr = l->data;
o = edje_object_add(_e_init_evas);
if (l == screens)
{
edje_object_file_set(o, s, "e/init/splash");
_e_init_object = o;
}
else
edje_object_file_set(o, s, "e/init/extra_screen");
evas_object_move(o, scr->x, scr->y);
evas_object_resize(o, scr->w, scr->h);
evas_object_show(o);
}
}
else
{
o = edje_object_add(_e_init_evas);
edje_object_file_set(o, s, "e/init/splash");
_e_init_object = o;
evas_object_move(o, 0, 0);
evas_object_resize(o, w, h);
evas_object_show(o);
}
edje_object_part_text_set(_e_init_object, "e.text.disable_text",
"Disable this splash screen in the future?");
edje_object_signal_callback_add(_e_init_object, "e,action,init,disable", "e",
_e_init_cb_signal_disable, NULL);
edje_object_signal_callback_add(_e_init_object, "e,action,init,enable", "e",
_e_init_cb_signal_enable, NULL);
edje_object_signal_callback_add(_e_init_object, "e,state,done_ok", "e",
_e_init_cb_signal_done_ok, NULL);
free(roots);
_e_init_timeout_timer = ecore_timer_add(240.0, _e_init_cb_timeout, NULL);
return 1;
}
EAPI int
e_init_shutdown(void)
{
ecore_event_handler_del(_e_init_configure_handler);
_e_init_configure_handler = NULL;
e_init_hide();
return 1;
}
EAPI void
e_init_show(void)
{
if (!_e_init_ecore_evas) return;
ecore_evas_raise(_e_init_ecore_evas);
ecore_evas_show(_e_init_ecore_evas);
}
EAPI void
e_init_hide(void)
{
if (!_e_init_ecore_evas) return;
ecore_evas_hide(_e_init_ecore_evas);
evas_object_del(_e_init_object);
ecore_evas_free(_e_init_ecore_evas);
_e_init_ecore_evas = NULL;
_e_init_evas = NULL;
_e_init_win = 0;
_e_init_object = NULL;
}
EAPI void
e_init_title_set(const char *str)
{
if (!_e_init_object) return;
edje_object_part_text_set(_e_init_object, "e.text.title", str);
}
EAPI void
e_init_version_set(const char *str)
{
if (!_e_init_object) return;
edje_object_part_text_set(_e_init_object, "e.text.version", str);
}
EAPI void
e_init_status_set(const char *str)
{
if (!_e_init_object) return;
edje_object_part_text_set(_e_init_object, "e.text.status", str);
}
EAPI void
e_init_done(void)
{
if (!_e_init_object) return;
edje_object_signal_emit(_e_init_object, "e,state,done", "e");
if (_e_init_timeout_timer) ecore_timer_del(_e_init_timeout_timer);
_e_init_timeout_timer = ecore_timer_add(60.0, _e_init_cb_timeout, NULL);
}
static void
_e_init_cb_signal_disable(void *data, Evas_Object *obj, const char *emission, const char *source)
{
if (!server) return;
ecore_ipc_server_send(server,
7/*E_IPC_DOMAIN_INIT*/,
2/*set splash*/,
0, 0, 0,
NULL, 0);
ecore_ipc_server_flush(server);
}
static void
_e_init_cb_signal_enable(void *data, Evas_Object *obj, const char *emission, const char *source)
{
if (!server) return;
ecore_ipc_server_send(server,
7/*E_IPC_DOMAIN_INIT*/,
2/*set splash*/,
1, 0, 0,
NULL, 0);
ecore_ipc_server_flush(server);
}
static void
_e_init_cb_signal_done_ok(void *data, Evas_Object *obj, const char *emission, const char *source)
{
e_init_hide();
if (_e_init_timeout_timer)
{
ecore_timer_del(_e_init_timeout_timer);
_e_init_timeout_timer = NULL;
}
ecore_main_loop_quit();
}
static int
_e_init_cb_window_configure(void *data, int ev_type, void *ev)
{
Ecore_X_Event_Window_Configure *e;
e = ev;
/* really simple - don't handle xinerama - because this event will only
* happen in single head */
if (e->win != _e_init_root_win) return 1;
ecore_evas_resize(_e_init_ecore_evas, e->w, e->h);
evas_object_resize(_e_init_object, e->w, e->h);
return 1;
}
static int
_e_init_cb_timeout(void *data)
{
e_init_hide();
_e_init_timeout_timer = NULL;
ecore_main_loop_quit();
return 0;
}
static Ecore_Evas *
_e_init_evas_new(Ecore_X_Window root, int w, int h, Ecore_X_Window *winret)
{
Ecore_Evas *ee;
Evas *e;
Evas_List *l;
if (engine == 0)
{
ee = ecore_evas_software_x11_new(NULL, root, 0, 0, w, h);
ecore_evas_override_set(ee, 1);
ecore_evas_software_x11_direct_resize_set(ee, 1);
*winret = ecore_evas_software_x11_window_get(ee);
}
else if (engine == 1)
{
ee = ecore_evas_xrender_x11_new(NULL, root, 0, 0, w, h);
ecore_evas_override_set(ee, 1);
ecore_evas_xrender_x11_direct_resize_set(ee, 1);
*winret = ecore_evas_xrender_x11_window_get(ee);
}
else if (engine == 2)
{
ee = ecore_evas_gl_x11_new(NULL, root, 0, 0, w, h);
ecore_evas_override_set(ee, 1);
ecore_evas_gl_x11_direct_resize_set(ee, 1);
*winret = ecore_evas_gl_x11_window_get(ee);
}
e = ecore_evas_get(ee);
evas_image_cache_set(e, 4096 * 1024);
evas_font_cache_set(e, 512 * 1024);
for (l = fpath; l; l = l->next) evas_font_path_append(e, l->data);
if (font_hinting == 0)
{
if (evas_font_hinting_can_hint(e, EVAS_FONT_HINTING_BYTECODE))
evas_font_hinting_set(e, EVAS_FONT_HINTING_BYTECODE);
else if (evas_font_hinting_can_hint(e, EVAS_FONT_HINTING_AUTO))
evas_font_hinting_set(e, EVAS_FONT_HINTING_AUTO);
else
evas_font_hinting_set(e, EVAS_FONT_HINTING_NONE);
}
else if (font_hinting == 1)
{
if (evas_font_hinting_can_hint(e, EVAS_FONT_HINTING_AUTO))
evas_font_hinting_set(e, EVAS_FONT_HINTING_AUTO);
else
evas_font_hinting_set(e, EVAS_FONT_HINTING_NONE);
}
else if (font_hinting == 2)
evas_font_hinting_set(e, EVAS_FONT_HINTING_NONE);
ecore_evas_name_class_set(ee, "E", "Init_Window");
ecore_evas_title_set(ee, "Enlightenment Init");
ecore_evas_raise(ee);
ecore_evas_show(ee);
return ee;
}

@ -119,6 +119,7 @@ _e_ipc_cb_client_del(void *data __UNUSED__, int type __UNUSED__, void *event)
/* delete client sruct */
e_thumb_client_del(e);
e_fm2_client_del(e);
e_init_client_del(e);
ecore_ipc_client_del(e->client);
return 1;
}
@ -151,6 +152,9 @@ _e_ipc_cb_client_data(void *data __UNUSED__, int type __UNUSED__, void *event)
case E_IPC_DOMAIN_FM:
e_fm2_client_data(e);
break;
case E_IPC_DOMAIN_INIT:
e_init_client_data(e);
break;
default:
break;
}

@ -15,6 +15,7 @@ typedef enum _E_Ipc_Domain
E_IPC_DOMAIN_EVENT,
E_IPC_DOMAIN_THUMB,
E_IPC_DOMAIN_FM,
E_IPC_DOMAIN_INIT,
E_IPC_DOMAIN_LAST
} E_Ipc_Domain;

@ -303,7 +303,6 @@ main(int argc, char **argv)
ecore_file_unlink(buf);
}
TS("edje init");
TS("ecore init");
/* basic ecore init */
@ -425,40 +424,6 @@ main(int argc, char **argv)
e_hints_init();
TS("x hints done");
TS("efreet");
/* init FDO desktop */
if (!efreet_init())
{
e_error_message_show(_("Enlightenment cannot initialize the FDO desktop system.\n"
"Perhaps you are out of memory?"));
_e_main_shutdown(-1);
}
_e_main_shutdown_push(efreet_shutdown);
if (!efreet_util_init())
{
e_error_message_show(_("Enlightenment cannot initialize the FDO desktop system.\n"
"Perhaps you are out of memory?"));
_e_main_shutdown(-1);
}
_e_main_shutdown_push(efreet_util_shutdown);
TS("efreet done");
TS("efreet paths");
{
Ecore_List *list;
list = efreet_icon_extra_list_get();
if (list)
{
snprintf(buf, sizeof(buf), "%s/.e/e/icons", e_user_homedir_get());
ecore_list_prepend(list, (void *)ecore_string_instance(buf));
snprintf(buf, sizeof(buf), "%s/data/icons", e_prefix_data_get());
ecore_list_prepend(list, (void *)ecore_string_instance(buf));
}
}
efreet_icon_extension_add(".edj");
TS("efreet paths done");
TS("ecore_evas init");
/* init the evas wrapper */
if (!ecore_evas_init())
@ -531,25 +496,6 @@ main(int argc, char **argv)
// _e_main_shutdown_push(ecore_evas_shutdown);
TS("test done");
TS("thumb init");
/* init the enlightenment thumbnailing system */
if (!e_thumb_init())
{
e_error_message_show(_("Enlightenment cannot initialize the Thumbnailing system.\n"));
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_thumb_shutdown);
TS("sys init");
/* init the enlightenment sys command system */
if (!e_sys_init())
{
e_error_message_show(_("Enlightenment cannot initialize the System Command system.\n"));
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_sys_shutdown);
/*** Finished loading subsystems, Loading WM Specifics ***/
TS("dirs");
@ -594,30 +540,10 @@ main(int argc, char **argv)
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_intl_post_shutdown);
TS("actions");
/* init actions system */
if (!e_actions_init())
{
e_error_message_show(_("Enlightenment cannot set up its actions system."));
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_actions_shutdown);
TS("bindings");
/* init bindings system */
if (!e_bindings_init())
{
e_error_message_show(_("Enlightenment cannot set up its bindings system."));
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_bindings_shutdown);
TS("popup");
/* init popup system */
if (!e_popup_init())
{
e_error_message_show(_("Enlightenment cannot set up its popup system."));
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_popup_shutdown);
TS("ipc");
/* setup e ipc service */
if (e_ipc_init())
_e_main_shutdown_push(e_ipc_shutdown);
/* setup edje to animate @ e_config->framerate frames per sec. */
edje_frametime_set(1.0 / e_config->framerate);
@ -641,14 +567,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_theme_shutdown);
TS("bg");
/* init desktop background system */
if (!e_bg_init())
{
e_error_message_show(_("Enlightenment cannot set up its desktop background system."));
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_bg_init);
TS("splash");
if (!((!e_config->show_splash) || (after_restart)))
{
@ -659,8 +578,106 @@ main(int argc, char **argv)
"Perhaps you are out of memory?"));
_e_main_shutdown(-1);
}
e_init_title_set(_("Enlightenment"));
e_init_version_set(VERSION);
e_init_show();
_e_main_shutdown_push(e_init_shutdown);
}
TS("efreet");
e_init_status_set(_("Starting Efreet"));
/* init FDO desktop */
if (!efreet_init())
{
e_error_message_show(_("Enlightenment cannot initialize the FDO desktop system.\n"
"Perhaps you are out of memory?"));
_e_main_shutdown(-1);
}
_e_main_shutdown_push(efreet_shutdown);
if (!efreet_util_init())
{
e_error_message_show(_("Enlightenment cannot initialize the FDO desktop system.\n"
"Perhaps you are out of memory?"));
_e_main_shutdown(-1);
}
_e_main_shutdown_push(efreet_util_shutdown);
TS("efreet done");
e_init_status_set(_("Setting up Paths"));
TS("efreet paths");
{
Ecore_List *list;
list = efreet_icon_extra_list_get();
if (list)
{
snprintf(buf, sizeof(buf), "%s/.e/e/icons", e_user_homedir_get());
ecore_list_prepend(list, (void *)ecore_string_instance(buf));
snprintf(buf, sizeof(buf), "%s/data/icons", e_prefix_data_get());
ecore_list_prepend(list, (void *)ecore_string_instance(buf));
}
}
efreet_icon_extension_add(".edj");
TS("efreet paths done");
e_init_status_set(_("Setup Thumbnailer"));
TS("thumb init");
/* init the enlightenment thumbnailing system */
if (!e_thumb_init())
{
e_error_message_show(_("Enlightenment cannot initialize the Thumbnailing system.\n"));
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_thumb_shutdown);
e_init_status_set(_("Setup System Controls"));
TS("sys init");
/* init the enlightenment sys command system */
if (!e_sys_init())
{
e_error_message_show(_("Enlightenment cannot initialize the System Command system.\n"));
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_sys_shutdown);
e_init_status_set(_("Setup Actions"));
TS("actions");
/* init actions system */
if (!e_actions_init())
{
e_error_message_show(_("Enlightenment cannot set up its actions system."));
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_actions_shutdown);
e_init_status_set(_("Setup Bindings"));
TS("bindings");
/* init bindings system */
if (!e_bindings_init())
{
e_error_message_show(_("Enlightenment cannot set up its bindings system."));
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_bindings_shutdown);
e_init_status_set(_("Setup Popups"));
TS("popup");
/* init popup system */
if (!e_popup_init())
{
e_error_message_show(_("Enlightenment cannot set up its popup system."));
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_popup_shutdown);
e_init_status_set(_("Setup Wallpaper"));
TS("bg");
/* init desktop background system */
if (!e_bg_init())
{
e_error_message_show(_("Enlightenment cannot set up its desktop background system."));
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_bg_init);
e_init_status_set(_("Setup Screens"));
TS("screens");
/* manage the root window */
if (!_e_main_screens_init())
@ -670,6 +687,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1);
}
_e_main_shutdown_push(_e_main_screens_shutdown);
e_init_status_set(_("Setup Execution System"));
TS("exec");
/* init app system */
if (!e_exec_init())
@ -678,6 +696,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_exec_shutdown);
e_init_status_set(_("Setup Remembers"));
TS("remember");
/* do remember stuff */
if (!e_remember_init(after_restart ? E_STARTUP_RESTART: E_STARTUP_START))
@ -690,11 +709,7 @@ main(int argc, char **argv)
TS("container freeze");
e_container_all_freeze();
TS("ipc");
/* setup e ipc service */
if (e_ipc_init())
_e_main_shutdown_push(e_ipc_shutdown);
e_init_status_set(_("Setup FM"));
TS("fm2");
/* init the enlightenment file manager */
if (!e_fm2_init())
@ -712,6 +727,7 @@ main(int argc, char **argv)
}
_e_main_shutdown_push(e_fwin_shutdown);
*/
e_init_status_set(_("Setup Message System"));
TS("msg");
/* setup generic msg handling etc */
if (!e_msg_init())
@ -720,6 +736,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_msg_shutdown);
e_init_status_set(_("Setup DND"));
TS("dnd");
/* setup dnd */
if (!e_dnd_init())
@ -728,6 +745,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_dnd_shutdown);
e_init_status_set(_("Setup Grab Input HAnding"));
TS("grabinput");
/* setup input grabbing co-operation system */
if (!e_grabinput_init())
@ -736,6 +754,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_grabinput_shutdown);
e_init_status_set(_("Setup Modules"));
TS("modules");
/* setup module loading etc */
if (!e_module_init())
@ -744,6 +763,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_module_shutdown);
e_init_status_set(_("Setup Color Classes"));
TS("colorclasses");
/* setup color_class */
if (!e_color_class_init())
@ -752,6 +772,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_color_class_shutdown);
e_init_status_set(_("Setup Gadcon"));
TS("gadcon");
/* setup gadcon */
if (!e_gadcon_init())
@ -760,6 +781,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1);
}
_e_main_shutdown_push(e_gadcon_shutdown);
e_init_status_set(_("Setup Shelves"));
TS("shelves");
/* setup shelves */
if (!e_shelf_init())
@ -769,6 +791,7 @@ main(int argc, char **argv)
}
_e_main_shutdown_push(e_shelf_shutdown);
e_init_status_set(_("Setup DPMS"));
TS("dpms");
/* setup dpms */
if (!e_dpms_init())
@ -777,6 +800,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1);
}
e_init_status_set(_("Setup Screensaver"));
TS("screensaver");
/* setup screensaver */
if (!e_screensaver_init())
@ -785,6 +809,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1);
}
e_init_status_set(_("Setup Mouse"));
TS("mouse");
/* setup mouse accel */
if (!e_mouse_init())
@ -793,6 +818,7 @@ main(int argc, char **argv)
_e_main_shutdown(-1);
}
e_init_status_set(_("Setup Desklock"));
TS("desklock");
/* setup desklock */
if (!e_desklock_init())
@ -802,6 +828,7 @@ main(int argc, char **argv)
}
_e_main_shutdown_push(e_desklock_shutdown);
e_init_status_set(_("Set Up File Ordering"));
TS("order");
if (!e_order_init())
{
@ -819,10 +846,6 @@ main(int argc, char **argv)
/* ecore_x_ungrab(); */
TS("init properites");
e_init_title_set(_("Enlightenment"));
e_init_version_set(VERSION);
e_init_status_set(_("Enlightenment Starting. Please wait."));
if (!nostartup)
{
if (after_restart) e_startup(E_STARTUP_RESTART);
@ -841,6 +864,7 @@ main(int argc, char **argv)
e_test();
/* load modules */
e_init_status_set(_("Load Modules"));
TS("load modules");
if (!safe_mode)
e_module_all_load();
@ -864,12 +888,14 @@ main(int argc, char **argv)
e_config_save_queue();
}
e_init_status_set(_("Configure Shelves"));
TS("shelf config init");
e_shelf_config_init();
/* 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_init_status_set(_("Almost Done"));
TS("MAIN LOOP AT LAST");
/* no longer starting up */
starting = 0;
@ -1099,7 +1125,6 @@ _e_main_screens_init(void)
E_Container *con;
man = e_manager_new(roots[i], i);
e_init_show();
if (man)
{
e_manager_show(man);

@ -100,15 +100,7 @@ e_manager_new(Ecore_X_Window root, int num)
ecore_x_icccm_title_set(man->win, "Enlightenment Manager");
ecore_x_netwm_name_set(man->win, "Enlightenment Manager");
mwin = e_menu_grab_window_get();
if (!mwin) mwin = e_init_window_get();
if (!mwin)
ecore_x_window_raise(man->win);
else
ecore_x_window_configure(man->win,
ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING |
ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
0, 0, 0, 0, 0,
mwin, ECORE_X_WINDOW_STACK_BELOW);
ecore_x_window_raise(man->win);
}
else
{
@ -183,7 +175,32 @@ e_manager_manage_windows(E_Manager *man)
int ret;
ecore_x_window_attributes_get(windows[i], &att);
if ((att.override) || (att.input_only)) continue;
if ((att.override) || (att.input_only))
{
if (att.override)
{
char *wname = NULL, *wclass = NULL;
ecore_x_icccm_name_class_get(windows[i],
&wname, &wclass);
if ((wname) && (wclass) &&
(!strcmp(wname, "E")) &&
(!strcmp(wclass, "Init_Window")))
{
free(wname);
free(wclass);
man->initwin = windows[i];
}
else
{
if (wname) free(wname);
if (wclass) free(wclass);
continue;
}
}
else
continue;
}
if (!ecore_x_window_prop_property_get(windows[i],
atom_xmbed,
atom_xmbed, 32,
@ -298,7 +315,7 @@ e_manager_show(E_Manager *man)
Ecore_X_Window mwin;
mwin = e_menu_grab_window_get();
if (!mwin) mwin = e_init_window_get();
if (!mwin) mwin = man->initwin;
if (!mwin)
ecore_x_window_raise(man->win);
else
@ -406,7 +423,7 @@ e_manager_raise(E_Manager *man)
Ecore_X_Window mwin;
mwin = e_menu_grab_window_get();
if (!mwin) mwin = e_init_window_get();
if (!mwin) mwin = man->initwin;