diff --git a/src/bin/e.h b/src/bin/e.h index 325bcb586..5e1f02eab 100644 --- a/src/bin/e.h +++ b/src/bin/e.h @@ -157,5 +157,6 @@ extern EAPI int restart; extern EAPI int good; extern EAPI int evil; extern EAPI int starting; +extern EAPI int stopping; #endif diff --git a/src/bin/e_border.c b/src/bin/e_border.c index 30af6d32a..804821c0a 100644 --- a/src/bin/e_border.c +++ b/src/bin/e_border.c @@ -745,6 +745,7 @@ e_border_hide(E_Border *bd, int manage) if (!manage) ecore_x_window_prop_card32_set(bd->client.win, E_ATOM_MANAGED, &visible, 1); + if (!stopping) { E_Event_Border_Hide *ev; @@ -3238,12 +3239,10 @@ _e_border_del(E_Border *bd) } bd->already_unparented = 1; - if (!bd->new_client) + if ((!bd->new_client) && (!stopping)) { ev = calloc(1, sizeof(E_Event_Border_Remove)); ev->border = bd; - /* FIXME Don't ref this during shutdown. And the event is pointless - * during shutdown.. */ e_object_ref(E_OBJECT(bd)); // e_object_breadcrumb_add(E_OBJECT(bd), "border_remove_event"); ecore_event_add(E_EVENT_BORDER_REMOVE, ev, _e_border_event_border_remove_free, NULL); diff --git a/src/bin/e_dnd.c b/src/bin/e_dnd.c index 108785e59..4d07c3d4e 100644 --- a/src/bin/e_dnd.c +++ b/src/bin/e_dnd.c @@ -124,13 +124,6 @@ e_dnd_shutdown(void) _event_handlers = NULL; evas_hash_free(_drop_win_hash); - for (l = _drop_handlers; l; l = l->next) - { - E_Drop_Handler *h; - - h = l->data; - e_drop_handler_del(h); - } evas_list_free(_drop_handlers); _drop_handlers = NULL; diff --git a/src/bin/e_fwin.c b/src/bin/e_fwin.c index 30e278160..3d767da7c 100644 --- a/src/bin/e_fwin.c +++ b/src/bin/e_fwin.c @@ -56,6 +56,14 @@ e_fwin_init(void) EAPI int e_fwin_shutdown(void) { + Evas_List *l, *tmp; + + for (l = fwins; l;) + { + tmp = l; + l = l->next; + e_object_del(E_OBJECT(tmp->data)); + } return 1; } diff --git a/src/bin/e_ipc.c b/src/bin/e_ipc.c index 9ca884e3f..42c7ff3c9 100644 --- a/src/bin/e_ipc.c +++ b/src/bin/e_ipc.c @@ -83,7 +83,7 @@ e_ipc_init(void) return 1; } -EAPI void +EAPI int e_ipc_shutdown(void) { #ifdef USE_IPC @@ -93,7 +93,8 @@ e_ipc_shutdown(void) ecore_ipc_server_del(_e_ipc_server); _e_ipc_server = NULL; } -#endif +#endif + return 1; } #ifdef USE_IPC diff --git a/src/bin/e_ipc.h b/src/bin/e_ipc.h index 0f8b9395b..a25847fea 100644 --- a/src/bin/e_ipc.h +++ b/src/bin/e_ipc.h @@ -25,8 +25,8 @@ typedef int E_Ipc_Op; #ifndef E_IPC_H #define E_IPC_H -EAPI int e_ipc_init(void); -EAPI void e_ipc_shutdown(void); +EAPI int e_ipc_init(void); +EAPI int e_ipc_shutdown(void); #endif #endif diff --git a/src/bin/e_main.c b/src/bin/e_main.c index f22bdf8c8..54e047ae9 100644 --- a/src/bin/e_main.c +++ b/src/bin/e_main.c @@ -16,8 +16,6 @@ static int _e_main_screens_init(void); static int _e_main_screens_shutdown(void); static int _e_main_path_init(void); static int _e_main_path_shutdown(void); -static int _e_main_ipc_init(void); -static int _e_main_ipc_shutdown(void); static void _e_main_cb_x_fatal(void *data); static int _e_main_cb_signal_exit(void *data, int ev_type, void *ev); @@ -514,8 +512,7 @@ main(int argc, char **argv) evas_object_del(im); ecore_evas_free(ee); } -// segv's on restart if fm open. -// _e_main_shutdown_push(ecore_evas_shutdown); + _e_main_shutdown_push(ecore_evas_shutdown); TS("test done"); TS("thumb init"); @@ -679,8 +676,8 @@ main(int argc, char **argv) TS("ipc"); /* setup e ipc service */ - if (_e_main_ipc_init()) - _e_main_shutdown_push(_e_main_ipc_shutdown); + if (e_ipc_init()) + _e_main_shutdown_push(e_ipc_shutdown); TS("fm2"); /* init the enlightenment file manager */ @@ -690,6 +687,13 @@ main(int argc, char **argv) _e_main_shutdown(-1); } _e_main_shutdown_push(e_fm2_shutdown); + TS("fwin"); + if (!e_fwin_init()) + { + e_error_message_show(_("Enlightenment cannot initialize the File manager.\n")); + _e_main_shutdown(-1); + } + _e_main_shutdown_push(e_fwin_shutdown); TS("msg"); /* setup generic msg handling etc */ if (!e_msg_init()) @@ -869,6 +873,7 @@ main(int argc, char **argv) starting = 0; /* start our main loop */ ecore_main_loop_begin(); + stopping = 1; /* ask all modules to save their config and then shutdown */ /* NB: no need to do this as config shutdown will flush any saves */ @@ -885,8 +890,8 @@ main(int argc, char **argv) if (restart) { /* selected shutdown */ - e_ipc_shutdown(); #if 0 + e_ipc_shutdown(); ecore_file_shutdown(); #endif e_util_env_set("E_RESTART_OK", "1"); @@ -1317,20 +1322,6 @@ _e_main_path_shutdown(void) return 1; } -static int -_e_main_ipc_init(void) -{ - if (!e_ipc_init()) return 0; - return 1; -} - -static int -_e_main_ipc_shutdown(void) -{ - e_ipc_shutdown(); - return 1; -} - static void _e_main_cb_x_fatal(void *data __UNUSED__) { diff --git a/src/bin/e_utils.c b/src/bin/e_utils.c index 5fc7f8c0f..f185e5ecf 100644 --- a/src/bin/e_utils.c +++ b/src/bin/e_utils.c @@ -16,6 +16,7 @@ EAPI int restart = 0; EAPI int good = 0; EAPI int evil = 0; EAPI int starting = 1; +EAPI int stopping = 0; typedef struct _E_Util_Fake_Mouse_Up_Info E_Util_Fake_Mouse_Up_Info;