summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorCedric Bail <cedric@osg.samsung.com>2017-10-27 16:20:56 -0700
committerCedric Bail <cedric@osg.samsung.com>2017-10-27 16:20:56 -0700
commita959337a2908db0e829dd2bdf8f92f1e13843ef4 (patch)
treeac6140909a78e3a7688b90f86198cf68d74cbbbe /src/lib/elementary
parentba01c5c3ebf4646b2196b00b7e3c99c823c1be5e (diff)
elementary: rely on main loop terminate event to execute ELM_POLICY_EXIT_WINDOWS_DEL.
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/elm_main.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c
index 9ce1423192..ddcddd9179 100644
--- a/src/lib/elementary/elm_main.c
+++ b/src/lib/elementary/elm_main.c
@@ -1344,6 +1344,16 @@ elm_run(void)
1344 ecore_main_loop_begin(); 1344 ecore_main_loop_begin();
1345} 1345}
1346 1346
1347static void
1348_on_terminate(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
1349{
1350 Eina_List *l, *l_next;
1351 Evas_Object *win;
1352
1353 EINA_LIST_FOREACH_SAFE(_elm_win_list, l, l_next, win)
1354 evas_object_del(win);
1355}
1356
1347EAPI void 1357EAPI void
1348efl_exit(int exit_code) 1358efl_exit(int exit_code)
1349{ 1359{
@@ -1352,15 +1362,6 @@ efl_exit(int exit_code)
1352 eina_value_setup(&v, EINA_VALUE_TYPE_INT); 1362 eina_value_setup(&v, EINA_VALUE_TYPE_INT);
1353 eina_value_set(&v, &exit_code); 1363 eina_value_set(&v, &exit_code);
1354 efl_loop_quit(ecore_main_loop_get(), v); 1364 efl_loop_quit(ecore_main_loop_get(), v);
1355
1356 if (elm_policy_get(ELM_POLICY_EXIT) == ELM_POLICY_EXIT_WINDOWS_DEL)
1357 {
1358 Eina_List *l, *l_next;
1359 Evas_Object *win;
1360
1361 EINA_LIST_FOREACH_SAFE(_elm_win_list, l, l_next, win)
1362 evas_object_del(win);
1363 }
1364} 1365}
1365 1366
1366EAPI void 1367EAPI void
@@ -1382,6 +1383,20 @@ elm_policy_set(unsigned int policy,
1382 if (value == _elm_policies[policy]) 1383 if (value == _elm_policies[policy])
1383 return EINA_TRUE; 1384 return EINA_TRUE;
1384 1385
1386 if (policy == ELM_POLICY_EXIT)
1387 {
1388 if (value == ELM_POLICY_EXIT_WINDOWS_DEL)
1389 {
1390 efl_event_callback_add(ecore_main_loop_get(), EFL_LOOP_EVENT_TERMINATE,
1391 _on_terminate, NULL);
1392 }
1393 else
1394 {
1395 efl_event_callback_del(ecore_main_loop_get(), EFL_LOOP_EVENT_TERMINATE,
1396 _on_terminate, NULL);
1397 }
1398 }
1399
1385 /* TODO: validate policy? */ 1400 /* TODO: validate policy? */
1386 1401
1387 ev = malloc(sizeof(*ev)); 1402 ev = malloc(sizeof(*ev));