forked from enlightenment/enlightenment
- 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:
parent
74ab197e1b
commit
e8590e0357
|
@ -157,5 +157,6 @@ extern EAPI int restart;
|
||||||
extern EAPI int good;
|
extern EAPI int good;
|
||||||
extern EAPI int evil;
|
extern EAPI int evil;
|
||||||
extern EAPI int starting;
|
extern EAPI int starting;
|
||||||
|
extern EAPI int stopping;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -745,6 +745,7 @@ e_border_hide(E_Border *bd, int manage)
|
||||||
if (!manage)
|
if (!manage)
|
||||||
ecore_x_window_prop_card32_set(bd->client.win, E_ATOM_MANAGED, &visible, 1);
|
ecore_x_window_prop_card32_set(bd->client.win, E_ATOM_MANAGED, &visible, 1);
|
||||||
|
|
||||||
|
if (!stopping)
|
||||||
{
|
{
|
||||||
E_Event_Border_Hide *ev;
|
E_Event_Border_Hide *ev;
|
||||||
|
|
||||||
|
@ -3238,12 +3239,10 @@ _e_border_del(E_Border *bd)
|
||||||
}
|
}
|
||||||
bd->already_unparented = 1;
|
bd->already_unparented = 1;
|
||||||
|
|
||||||
if (!bd->new_client)
|
if ((!bd->new_client) && (!stopping))
|
||||||
{
|
{
|
||||||
ev = calloc(1, sizeof(E_Event_Border_Remove));
|
ev = calloc(1, sizeof(E_Event_Border_Remove));
|
||||||
ev->border = bd;
|
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_ref(E_OBJECT(bd));
|
||||||
// e_object_breadcrumb_add(E_OBJECT(bd), "border_remove_event");
|
// 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);
|
ecore_event_add(E_EVENT_BORDER_REMOVE, ev, _e_border_event_border_remove_free, NULL);
|
||||||
|
|
|
@ -124,13 +124,6 @@ e_dnd_shutdown(void)
|
||||||
_event_handlers = NULL;
|
_event_handlers = NULL;
|
||||||
|
|
||||||
evas_hash_free(_drop_win_hash);
|
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);
|
evas_list_free(_drop_handlers);
|
||||||
_drop_handlers = NULL;
|
_drop_handlers = NULL;
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,14 @@ e_fwin_init(void)
|
||||||
EAPI int
|
EAPI int
|
||||||
e_fwin_shutdown(void)
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ e_ipc_init(void)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI int
|
||||||
e_ipc_shutdown(void)
|
e_ipc_shutdown(void)
|
||||||
{
|
{
|
||||||
#ifdef USE_IPC
|
#ifdef USE_IPC
|
||||||
|
@ -93,7 +93,8 @@ e_ipc_shutdown(void)
|
||||||
ecore_ipc_server_del(_e_ipc_server);
|
ecore_ipc_server_del(_e_ipc_server);
|
||||||
_e_ipc_server = NULL;
|
_e_ipc_server = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_IPC
|
#ifdef USE_IPC
|
||||||
|
|
|
@ -25,8 +25,8 @@ typedef int E_Ipc_Op;
|
||||||
#ifndef E_IPC_H
|
#ifndef E_IPC_H
|
||||||
#define E_IPC_H
|
#define E_IPC_H
|
||||||
|
|
||||||
EAPI int e_ipc_init(void);
|
EAPI int e_ipc_init(void);
|
||||||
EAPI void e_ipc_shutdown(void);
|
EAPI int e_ipc_shutdown(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -16,8 +16,6 @@ static int _e_main_screens_init(void);
|
||||||
static int _e_main_screens_shutdown(void);
|
static int _e_main_screens_shutdown(void);
|
||||||
static int _e_main_path_init(void);
|
static int _e_main_path_init(void);
|
||||||
static int _e_main_path_shutdown(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 void _e_main_cb_x_fatal(void *data);
|
||||||
static int _e_main_cb_signal_exit(void *data, int ev_type, void *ev);
|
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);
|
evas_object_del(im);
|
||||||
ecore_evas_free(ee);
|
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("test done");
|
||||||
|
|
||||||
TS("thumb init");
|
TS("thumb init");
|
||||||
|
@ -679,8 +676,8 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
TS("ipc");
|
TS("ipc");
|
||||||
/* setup e ipc service */
|
/* setup e ipc service */
|
||||||
if (_e_main_ipc_init())
|
if (e_ipc_init())
|
||||||
_e_main_shutdown_push(_e_main_ipc_shutdown);
|
_e_main_shutdown_push(e_ipc_shutdown);
|
||||||
|
|
||||||
TS("fm2");
|
TS("fm2");
|
||||||
/* init the enlightenment file manager */
|
/* init the enlightenment file manager */
|
||||||
|
@ -690,6 +687,13 @@ main(int argc, char **argv)
|
||||||
_e_main_shutdown(-1);
|
_e_main_shutdown(-1);
|
||||||
}
|
}
|
||||||
_e_main_shutdown_push(e_fm2_shutdown);
|
_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");
|
TS("msg");
|
||||||
/* setup generic msg handling etc */
|
/* setup generic msg handling etc */
|
||||||
if (!e_msg_init())
|
if (!e_msg_init())
|
||||||
|
@ -869,6 +873,7 @@ main(int argc, char **argv)
|
||||||
starting = 0;
|
starting = 0;
|
||||||
/* start our main loop */
|
/* start our main loop */
|
||||||
ecore_main_loop_begin();
|
ecore_main_loop_begin();
|
||||||
|
stopping = 1;
|
||||||
|
|
||||||
/* ask all modules to save their config and then shutdown */
|
/* ask all modules to save their config and then shutdown */
|
||||||
/* NB: no need to do this as config shutdown will flush any saves */
|
/* NB: no need to do this as config shutdown will flush any saves */
|
||||||
|
@ -885,8 +890,8 @@ main(int argc, char **argv)
|
||||||
if (restart)
|
if (restart)
|
||||||
{
|
{
|
||||||
/* selected shutdown */
|
/* selected shutdown */
|
||||||
e_ipc_shutdown();
|
|
||||||
#if 0
|
#if 0
|
||||||
|
e_ipc_shutdown();
|
||||||
ecore_file_shutdown();
|
ecore_file_shutdown();
|
||||||
#endif
|
#endif
|
||||||
e_util_env_set("E_RESTART_OK", "1");
|
e_util_env_set("E_RESTART_OK", "1");
|
||||||
|
@ -1317,20 +1322,6 @@ _e_main_path_shutdown(void)
|
||||||
return 1;
|
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
|
static void
|
||||||
_e_main_cb_x_fatal(void *data __UNUSED__)
|
_e_main_cb_x_fatal(void *data __UNUSED__)
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,6 +16,7 @@ EAPI int restart = 0;
|
||||||
EAPI int good = 0;
|
EAPI int good = 0;
|
||||||
EAPI int evil = 0;
|
EAPI int evil = 0;
|
||||||
EAPI int starting = 1;
|
EAPI int starting = 1;
|
||||||
|
EAPI int stopping = 0;
|
||||||
|
|
||||||
typedef struct _E_Util_Fake_Mouse_Up_Info E_Util_Fake_Mouse_Up_Info;
|
typedef struct _E_Util_Fake_Mouse_Up_Info E_Util_Fake_Mouse_Up_Info;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue