- Add flag to indicate when main loop has ended.

- Don't allow (some) events during shutdown, as events wont be processed.
- Don't remove drop handlers on dnd shutdown, they should be removed by
  their creators.
- init/shutdown fwin
- Delete fwins on shutdown.
- Remove weird ipc wrapper function.
- Don't do additional shutdown functions on restart.


SVN revision: 29366
This commit is contained in:
Sebastian Dransfeld 2007-04-05 06:59:02 +00:00
parent 74ab197e1b
commit e8590e0357
8 changed files with 29 additions and 35 deletions

View File

@ -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

View File

@ -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);

View File

@ -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;

View File

@ -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;
}

View File

@ -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

View File

@ -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

View File

@ -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__)
{

View File

@ -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;