summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlastair Poole <netstar@gmail.com>2020-06-30 13:23:01 +0100
committerAlastair Poole <netstar@gmail.com>2020-06-30 13:23:01 +0100
commita5461ad41652446b39e5a21494949f215eb6c94d (patch)
tree77f5c3743a3a35899f0fffaeb1d4029e31163838
parentd2a72510cb79a83f1b03aa1bfad57f2fe6e1abbb (diff)
shutdown: allow control of cleaning up.
Flag to shutdown now or ordered triggering callbacks.
-rw-r--r--src/bin/main.c2
-rw-r--r--src/bin/ui/ui.c7
-rw-r--r--src/bin/ui/ui.h1
3 files changed, 9 insertions, 1 deletions
diff --git a/src/bin/main.c b/src/bin/main.c
index 6ef07e6..a9ee8bb 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -46,6 +46,8 @@ _win_add(void)
46 if (!ui) 46 if (!ui)
47 return NULL; 47 return NULL;
48 48
49 ui->shutdown_now = EINA_TRUE;
50
49 evas_object_smart_callback_add(win, "delete,request", _win_del_cb, ui); 51 evas_object_smart_callback_add(win, "delete,request", _win_del_cb, ui);
50 evas_object_show(win); 52 evas_object_show(win);
51 53
diff --git a/src/bin/ui/ui.c b/src/bin/ui/ui.c
index f503767..0e6b926 100644
--- a/src/bin/ui/ui.c
+++ b/src/bin/ui/ui.c
@@ -747,7 +747,7 @@ _quit_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
747{ 747{
748 Ui *ui = data; 748 Ui *ui = data;
749 749
750 evas_object_hide(ui->win); 750 ui->shutdown_now = EINA_TRUE;
751 evisum_ui_shutdown(ui); 751 evisum_ui_shutdown(ui);
752} 752}
753 753
@@ -1282,6 +1282,11 @@ _evisum_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
1282void 1282void
1283evisum_ui_shutdown(Ui *ui) 1283evisum_ui_shutdown(Ui *ui)
1284{ 1284{
1285 if (ui->shutdown_now)
1286 {
1287 exit(0);
1288 }
1289
1285 if (ui->win_cpu) 1290 if (ui->win_cpu)
1286 evas_object_smart_callback_call(ui->win_cpu, "delete,request", NULL); 1291 evas_object_smart_callback_call(ui->win_cpu, "delete,request", NULL);
1287 if (ui->win_mem) 1292 if (ui->win_mem)
diff --git a/src/bin/ui/ui.h b/src/bin/ui/ui.h
index 8964dc5..20f023b 100644
--- a/src/bin/ui/ui.h
+++ b/src/bin/ui/ui.h
@@ -87,6 +87,7 @@ typedef struct Ui
87 Sort_Type sort_type; 87 Sort_Type sort_type;
88 Eina_Bool sort_reverse; 88 Eina_Bool sort_reverse;
89 Eina_Bool show_self; 89 Eina_Bool show_self;
90 Eina_Bool shutdown_now;
90 91
91 Eina_Bool zfs_mounted; 92 Eina_Bool zfs_mounted;
92 93