From: <enl...@li...> - 2003-08-26 05:29:10
|
Enlightenment CVS committal Author : atmosphere Project : e17 Module : apps/entice Dir : e17/apps/entice/src/bin Modified Files: entice_ipc.c event.c event.h misc.c Log Message: * A few minor fixups in entice_ipc after talking to raster * Changed the IPC_TITLE to entice (rm -rf ~/.ecore/entice*) * Setup a callback for window delete events so ecore_ipc closes down properly * Seems to fix the last of the "i still get two windows =(" behavior =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/entice_ipc.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- entice_ipc.c 25 Aug 2003 19:44:21 -0000 1.1 +++ entice_ipc.c 26 Aug 2003 05:21:49 -0000 1.2 @@ -2,8 +2,7 @@ #include <Ecore_Ipc.h> #include <limits.h> -#define IPC_TITLE "entice000" -static Ecore_Ipc_Server *server = NULL; +#define IPC_TITLE "entice" /** * ipc_server_add - when we connect to the ipc daemon @@ -110,10 +109,12 @@ entice_ipc_init (int argc, const char **argv) { int i; + Ecore_Ipc_Server *server = NULL; /* we definitely fail if we can't connect to ecore_ipc */ if(ecore_ipc_init () < 1) return(1); + /* If we can connect to a currently running entice process */ if((server=ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER,IPC_TITLE, 0,NULL))) { char buf[PATH_MAX]; @@ -135,6 +136,7 @@ ecore_ipc_server_del(server); return(1); } + /* Otherwise we create it */ else { // printf("creating new server\n"); @@ -155,7 +157,5 @@ entice_ipc_shutdown(void) { // printf("shutting down IPC\n"); - if(server) ecore_ipc_server_del(server); - server = NULL; ecore_ipc_shutdown(); } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/event.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -3 -r1.19 -r1.20 --- event.c 25 Aug 2003 19:44:21 -0000 1.19 +++ event.c 26 Aug 2003 05:21:49 -0000 1.20 @@ -81,6 +81,12 @@ } void +e_window_delete(Ecore_Evas *ee) +{ + ecore_main_loop_quit(); +} + +void e_key_down(void* data, Evas * unused, Evas_Object *obj, void *event_info) { Evas_Event_Key_Down *e; @@ -180,7 +186,10 @@ } else if (!strcmp(e->keyname, "Escape")) { + ecore_main_loop_quit(); + /* exit(0); + */ } else if (!strcmp(e->keyname, "Return")) { =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/event.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- event.h 9 Aug 2003 00:50:38 -0000 1.4 +++ event.h 26 Aug 2003 05:21:49 -0000 1.5 @@ -19,6 +19,8 @@ void e_window_resize(Ecore_Evas *ee); /* when the window gets moved or resized */ +void e_window_delete(Ecore_Evas *ee); +/* when they click the little X in the corner */ //int e_window_configure(void* data, int ev_type, Ecore_Event *ev); /* when a key gets pressed */ =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/misc.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- misc.c 25 Aug 2003 19:44:21 -0000 1.14 +++ misc.c 26 Aug 2003 05:21:49 -0000 1.15 @@ -37,6 +37,7 @@ /* create a 400x300 toplevel window */ ecore_evas = ecore_evas_software_x11_new(NULL, 0, 0, 0, win_w, win_h); ecore_evas_callback_resize_set(ecore_evas, e_window_resize); + ecore_evas_callback_delete_request_set(ecore_evas, e_window_delete); // main_win = ecore_evas_software_x11_window_get(ecore_evas); ecore_evas_name_class_set(ecore_evas, "Entice", "Main"); ecore_evas_size_min_set(ecore_evas, 288, 128); |