summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-06-05 17:28:09 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-06-05 17:31:15 +0100
commit1bdadff6c3fe4a508cc5bae4e9cdb602dc76b9ec (patch)
tree6c1af542e0a8368052abe6b3841d7a70b776f07b
parent10c4a25aa8b784ececaa5b5c1429f443d50e9619 (diff)
efm - make enlightenment_fm and eeze_scanner die with parent
be both explicit in killing it off on shutdown as well as using die with parent flags as well. this seems ot have fixed or reduced the "system cant shut down some job still alive in some session" problem. @fix
-rw-r--r--src/bin/e_fm.c27
-rw-r--r--src/bin/e_fm.h1
-rw-r--r--src/bin/e_fm/e_fm_main_eeze.c2
-rw-r--r--src/bin/e_sys.c17
4 files changed, 40 insertions, 7 deletions
diff --git a/src/bin/e_fm.c b/src/bin/e_fm.c
index 256c38e4e..5daa7dc29 100644
--- a/src/bin/e_fm.c
+++ b/src/bin/e_fm.c
@@ -479,6 +479,7 @@ static void _e_fm2_thread_cleanup_cb(void *d, Ecore_Thread *et);
479 479
480static void _e_fm2_new_file(void *data, E_Menu *m, E_Menu_Item *mi); 480static void _e_fm2_new_file(void *data, E_Menu *m, E_Menu_Item *mi);
481 481
482static Ecore_Exe *_e_fm2_exe = NULL;
482static char *_e_fm2_meta_path = NULL; 483static char *_e_fm2_meta_path = NULL;
483static Evas_Smart *_e_fm2_smart = NULL; 484static Evas_Smart *_e_fm2_smart = NULL;
484static Eina_List *_e_fm2_list = NULL; 485static Eina_List *_e_fm2_list = NULL;
@@ -751,6 +752,14 @@ _e_fm2_op_registry_entry_print(const E_Fm2_Op_Registry_Entry *ere)
751} 752}
752 753
753static Eina_Bool 754static Eina_Bool
755_e_fm2_exe_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
756{
757 Ecore_Exe_Event_Del *ev = event;
758 if (ev->exe == _e_fm2_exe) _e_fm2_exe = NULL;
759 return ECORE_CALLBACK_RENEW;
760}
761
762static Eina_Bool
754_e_fm2_op_registry_entry_add_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) 763_e_fm2_op_registry_entry_add_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
755{ 764{
756 const E_Fm2_Op_Registry_Entry *ere = event; 765 const E_Fm2_Op_Registry_Entry *ere = event;
@@ -840,6 +849,7 @@ e_fm2_init(void)
840 _e_fm2_thread_cleanup_cb, 849 _e_fm2_thread_cleanup_cb,
841 _e_fm2_thread_cleanup_cb, NULL); 850 _e_fm2_thread_cleanup_cb, NULL);
842 851
852 E_LIST_HANDLER_APPEND(_e_fm_handlers, ECORE_EXE_EVENT_DEL, _e_fm2_exe_del, NULL);
843 /// DBG 853 /// DBG
844 E_LIST_HANDLER_APPEND(_e_fm_handlers, E_EVENT_FM_OP_REGISTRY_ADD, _e_fm2_op_registry_entry_add_cb, NULL); 854 E_LIST_HANDLER_APPEND(_e_fm_handlers, E_EVENT_FM_OP_REGISTRY_ADD, _e_fm2_op_registry_entry_add_cb, NULL);
845 E_LIST_HANDLER_APPEND(_e_fm_handlers, E_EVENT_FM_OP_REGISTRY_DEL, _e_fm2_op_registry_entry_del_cb, NULL); 855 E_LIST_HANDLER_APPEND(_e_fm_handlers, E_EVENT_FM_OP_REGISTRY_DEL, _e_fm2_op_registry_entry_del_cb, NULL);
@@ -854,6 +864,8 @@ e_fm2_init(void)
854EINTERN int 864EINTERN int
855e_fm2_shutdown(void) 865e_fm2_shutdown(void)
856{ 866{
867 e_fm2_die();
868
857 E_FREE_LIST(_e_fm2_list, evas_object_del); 869 E_FREE_LIST(_e_fm2_list, evas_object_del);
858 870
859 eina_stringshare_replace(&_e_fm2_icon_desktop_str, NULL); 871 eina_stringshare_replace(&_e_fm2_icon_desktop_str, NULL);
@@ -887,6 +899,17 @@ e_fm2_shutdown(void)
887 return 1; 899 return 1;
888} 900}
889 901
902E_API void
903e_fm2_die(void)
904{
905 if (_e_fm2_exe)
906 {
907 ecore_exe_kill(_e_fm2_exe);
908 ecore_exe_free(_e_fm2_exe);
909 _e_fm2_exe = NULL;
910 }
911}
912
890E_API Evas_Object * 913E_API Evas_Object *
891e_fm2_add(Evas *evas) 914e_fm2_add(Evas *evas)
892{ 915{
@@ -2391,8 +2414,10 @@ _e_fm2_client_spawn(void)
2391 char buf[4096]; 2414 char buf[4096];
2392 2415
2393 if (_e_fm2_client_spawning) return; 2416 if (_e_fm2_client_spawning) return;
2417 if (e_sys_on_the_way_out_get()) return;
2394 snprintf(buf, sizeof(buf), "%s/enlightenment/utils/enlightenment_fm", e_prefix_lib_get()); 2418 snprintf(buf, sizeof(buf), "%s/enlightenment/utils/enlightenment_fm", e_prefix_lib_get());
2395 ecore_exe_run(buf, NULL); 2419 if (_e_fm2_exe) e_fm2_die();
2420 _e_fm2_exe = ecore_exe_pipe_run(buf, ECORE_EXE_NOT_LEADER | ECORE_EXE_TERM_WITH_PARENT, NULL);
2396 _e_fm2_client_spawning = 1; 2421 _e_fm2_client_spawning = 1;
2397} 2422}
2398 2423
diff --git a/src/bin/e_fm.h b/src/bin/e_fm.h
index 6bf0396a8..89dfcc42b 100644
--- a/src/bin/e_fm.h
+++ b/src/bin/e_fm.h
@@ -150,6 +150,7 @@ typedef void (*E_Fm_Cb)(void *data, Evas_Object *obj, E_Menu *m, E_Fm2_Icon_Info
150 150
151EINTERN int e_fm2_init(void); 151EINTERN int e_fm2_init(void);
152EINTERN int e_fm2_shutdown(void); 152EINTERN int e_fm2_shutdown(void);
153E_API void e_fm2_die(void);
153E_API Evas_Object *e_fm2_add(Evas *evas); 154E_API Evas_Object *e_fm2_add(Evas *evas);
154E_API void e_fm2_path_set(Evas_Object *obj, const char *dev, const char *path); 155E_API void e_fm2_path_set(Evas_Object *obj, const char *dev, const char *path);
155E_API void e_fm2_custom_theme_set(Evas_Object *obj, const char *path); 156E_API void e_fm2_custom_theme_set(Evas_Object *obj, const char *path);
diff --git a/src/bin/e_fm/e_fm_main_eeze.c b/src/bin/e_fm/e_fm_main_eeze.c
index b7d9e3eba..0fcffa249 100644
--- a/src/bin/e_fm/e_fm_main_eeze.c
+++ b/src/bin/e_fm/e_fm_main_eeze.c
@@ -654,7 +654,7 @@ _scanner_run(void)
654{ 654{
655 static int count; 655 static int count;
656 656
657 scanner = ecore_exe_pipe_run("eeze_scanner", ECORE_EXE_NOT_LEADER, pfx); 657 scanner = ecore_exe_pipe_run("eeze_scanner", ECORE_EXE_NOT_LEADER | ECORE_EXE_TERM_WITH_PARENT, pfx);
658 if (!scanner) 658 if (!scanner)
659 if (++count == 3) 659 if (++count == 3)
660 _e_fm_main_catch(EFM_MODE_USING_RASTER_MOUNT); 660 _e_fm_main_catch(EFM_MODE_USING_RASTER_MOUNT);
diff --git a/src/bin/e_sys.c b/src/bin/e_sys.c
index 27157a362..250925b84 100644
--- a/src/bin/e_sys.c
+++ b/src/bin/e_sys.c
@@ -1079,7 +1079,10 @@ _e_sys_action_do(E_Sys_Action a, char *param EINA_UNUSED, Eina_Bool raw)
1079 case E_SYS_EXIT: 1079 case E_SYS_EXIT:
1080 // XXX TODO: check for e_fm_op_registry entries and confirm 1080 // XXX TODO: check for e_fm_op_registry entries and confirm
1081 if (!e_util_immortal_check()) 1081 if (!e_util_immortal_check())
1082 ecore_main_loop_quit(); 1082 {
1083 e_fm2_die();
1084 ecore_main_loop_quit();
1085 }
1083 else 1086 else
1084 return 0; 1087 return 0;
1085 break; 1088 break;
@@ -1088,10 +1091,11 @@ _e_sys_action_do(E_Sys_Action a, char *param EINA_UNUSED, Eina_Bool raw)
1088 // XXX TODO: check for e_fm_op_registry entries and confirm 1091 // XXX TODO: check for e_fm_op_registry entries and confirm
1089 // FIXME: we don't share out immortal info to restarted e. :( 1092 // FIXME: we don't share out immortal info to restarted e. :(
1090// if (!e_util_immortal_check()) 1093// if (!e_util_immortal_check())
1091 { 1094 {
1092 restart = 1; 1095 e_fm2_die();
1093 ecore_main_loop_quit(); 1096 restart = 1;
1094 } 1097 ecore_main_loop_quit();
1098 }
1095// else 1099// else
1096// return 0; 1100// return 0;
1097 break; 1101 break;
@@ -1104,6 +1108,7 @@ _e_sys_action_do(E_Sys_Action a, char *param EINA_UNUSED, Eina_Bool raw)
1104 // XXX TODO: check for e_fm_op_registry entries and confirm 1108 // XXX TODO: check for e_fm_op_registry entries and confirm
1105 if (raw) 1109 if (raw)
1106 { 1110 {
1111 e_fm2_die();
1107 _e_sys_logout_after(); 1112 _e_sys_logout_after();
1108 } 1113 }
1109 else if (!_e_sys_comp_waiting) 1114 else if (!_e_sys_comp_waiting)
@@ -1116,6 +1121,7 @@ _e_sys_action_do(E_Sys_Action a, char *param EINA_UNUSED, Eina_Bool raw)
1116 case E_SYS_HALT_NOW: 1121 case E_SYS_HALT_NOW:
1117 /* shutdown -h now */ 1122 /* shutdown -h now */
1118 if (e_util_immortal_check()) return 0; 1123 if (e_util_immortal_check()) return 0;
1124 e_fm2_die();
1119 snprintf(buf, sizeof(buf), 1125 snprintf(buf, sizeof(buf),
1120 "%s/enlightenment/utils/enlightenment_sys halt", 1126 "%s/enlightenment/utils/enlightenment_sys halt",
1121 e_prefix_lib_get()); 1127 e_prefix_lib_get());
@@ -1151,6 +1157,7 @@ _e_sys_action_do(E_Sys_Action a, char *param EINA_UNUSED, Eina_Bool raw)
1151 case E_SYS_REBOOT: 1157 case E_SYS_REBOOT:
1152 /* shutdown -r now */ 1158 /* shutdown -r now */
1153 if (e_util_immortal_check()) return 0; 1159 if (e_util_immortal_check()) return 0;
1160 e_fm2_die();
1154 snprintf(buf, sizeof(buf), 1161 snprintf(buf, sizeof(buf),
1155 "%s/enlightenment/utils/enlightenment_sys reboot", 1162 "%s/enlightenment/utils/enlightenment_sys reboot",
1156 e_prefix_lib_get()); 1163 e_prefix_lib_get());