E17: Fix White Box of Death wrt Restart & Exit.

SVN revision: 62488
This commit is contained in:
Christopher Michael 2011-08-15 19:37:39 +00:00
parent cdf4cbfc0e
commit 072478fce3
3 changed files with 11 additions and 23 deletions

View File

@ -37,7 +37,8 @@ e_alert_show(int sig)
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
"%s/enlightenment/utils/enlightenment_alert %d %lu %lu", "%s/enlightenment/utils/enlightenment_alert %d %lu %lu",
e_prefix_lib_get(), sig, (long unsigned int)getpid(), e_alert_composite_win); e_prefix_lib_get(), sig, (long unsigned int)getpid(),
e_alert_composite_win);
alert_exe = ecore_exe_run(buf, NULL); alert_exe = ecore_exe_run(buf, NULL);
pause(); pause();

View File

@ -41,7 +41,6 @@ static void _e_alert_exit_e(void);
/* local variables */ /* local variables */
static Ecore_Ipc_Server *_ipc_server = NULL; static Ecore_Ipc_Server *_ipc_server = NULL;
static Ecore_Ipc_Server *_server = NULL;
static xcb_connection_t *conn = NULL; static xcb_connection_t *conn = NULL;
static xcb_screen_t *screen = NULL; static xcb_screen_t *screen = NULL;
static xcb_window_t win = 0, comp_win = 0; static xcb_window_t win = 0, comp_win = 0;
@ -79,6 +78,7 @@ main(int argc, char **argv)
} }
if (!ecore_init()) return EXIT_FAILURE; if (!ecore_init()) return EXIT_FAILURE;
ecore_app_args_set(argc, (const char **)argv);
if (!ecore_ipc_init()) if (!ecore_ipc_init())
{ {
ecore_shutdown(); ecore_shutdown();
@ -134,22 +134,9 @@ _e_alert_ipc_init(void)
_ipc_server = _ipc_server =
ecore_ipc_server_connect(ECORE_IPC_LOCAL_SYSTEM, edir, 0, NULL); ecore_ipc_server_connect(ECORE_IPC_LOCAL_SYSTEM, edir, 0, NULL);
if (!_ipc_server) return 0; if (!_ipc_server) return 0;
ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_ADD,
_e_alert_ipc_server_add, NULL);
return 1; return 1;
} }
static Eina_Bool
_e_alert_ipc_server_add(void *data, int type, void *event)
{
Ecore_Ipc_Event_Server_Add *e;
e = event;
_server = e->server;
return ECORE_CALLBACK_PASS_ON;
}
static int static int
_e_alert_connect(void) _e_alert_connect(void)
{ {
@ -376,7 +363,7 @@ _e_alert_run(void)
break; break;
} }
free(event); free(event);
if (ret > 0) break; if (ret > 0) return;
} }
} }
@ -609,15 +596,15 @@ _e_alert_draw_button_text(void)
static void static void
_e_alert_restart_e(void) _e_alert_restart_e(void)
{ {
kill(getppid(), SIGUSR2); kill(pid, SIGUSR2);
ecore_ipc_server_send(_server, 8, 0, 0, 0, 0, NULL, 0); ecore_ipc_server_send(_ipc_server, 8, 0, 0, 0, 0, NULL, 0);
ecore_ipc_server_flush(_server); ecore_ipc_server_flush(_ipc_server);
} }
static void static void
_e_alert_exit_e(void) _e_alert_exit_e(void)
{ {
kill(getppid(), SIGUSR2); kill(pid, SIGUSR2);
ecore_ipc_server_send(_server, 8, 1, 0, 0, 0, NULL, 0); ecore_ipc_server_send(_ipc_server, 8, 1, 0, 0, 0, NULL, 0);
ecore_ipc_server_flush(_server); ecore_ipc_server_flush(_ipc_server);
} }

View File

@ -212,7 +212,7 @@ _e_ipc_cb_client_data(void *data __UNUSED__, int type __UNUSED__, void *event)
a = e_action_find("restart"); a = e_action_find("restart");
break; break;
case E_ALERT_OP_EXIT: case E_ALERT_OP_EXIT:
a = e_action_find("exit"); a = e_action_find("exit_now");
break; break;
} }
if ((a) && (a->func.go)) a->func.go(NULL, NULL); if ((a) && (a->func.go)) a->func.go(NULL, NULL);