summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-05-28 23:07:56 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-05-28 23:07:56 +0100
commitaf63443e1974295a149a1d8216bbd308046ed09c (patch)
tree022bd74fcc1d0c99d690e3b8e0cc68a441be0e52 /src
parent596def7806fe63fe9339eba8b25cc86d7ce80b34 (diff)
sys - fix non-systemd code patch for suspend/resume handling/tracking
so in the non-systemd case there was a current e sys action stored and never cleared. e keeps thinking it is in the midddle of an action as it was not cleared. the systemd code path was different and didn't suffer from this. this fixes that so the non-systemd path works too. @fix
Diffstat (limited to 'src')
-rw-r--r--src/bin/e_sys.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/bin/e_sys.c b/src/bin/e_sys.c
index 89c388097..b6066d38f 100644
--- a/src/bin/e_sys.c
+++ b/src/bin/e_sys.c
@@ -64,7 +64,7 @@ E_API int E_EVENT_SYS_RESUME = -1;
64static Eina_Bool 64static Eina_Bool
65_e_sys_comp_done2_cb(void *data) 65_e_sys_comp_done2_cb(void *data)
66{ 66{
67 printf("_e_sys_comp_done2_cb %p\n", data); 67 printf("SSS: _e_sys_comp_done2_cb %p\n", data);
68 e_sys_action_raw_do((E_Sys_Action)(long)data, NULL); 68 e_sys_action_raw_do((E_Sys_Action)(long)data, NULL);
69 return EINA_FALSE; 69 return EINA_FALSE;
70} 70}
@@ -268,6 +268,7 @@ _e_sys_comp_resume2(void *data EINA_UNUSED)
268 Eina_List *l; 268 Eina_List *l;
269 E_Zone *zone; 269 E_Zone *zone;
270 270
271 _e_sys_action_current = E_SYS_NONE;
271#ifndef HAVE_WAYLAND_ONLY 272#ifndef HAVE_WAYLAND_ONLY
272 if (e_comp->comp_type == E_PIXMAP_TYPE_X) 273 if (e_comp->comp_type == E_PIXMAP_TYPE_X)
273 _e_comp_x_screensaver_off(); 274 _e_comp_x_screensaver_off();
@@ -289,6 +290,7 @@ _e_sys_comp_resume2(void *data EINA_UNUSED)
289static void 290static void
290_e_sys_comp_resume(void) 291_e_sys_comp_resume(void)
291{ 292{
293 printf("SSS: sys resume ... \n");
292 edje_thaw(); 294 edje_thaw();
293 ecore_evas_manual_render_set(e_comp->ee, EINA_FALSE); 295 ecore_evas_manual_render_set(e_comp->ee, EINA_FALSE);
294 evas_damage_rectangle_add(e_comp->evas, 0, 0, e_comp->w, e_comp->h); 296 evas_damage_rectangle_add(e_comp->evas, 0, 0, e_comp->w, e_comp->h);
@@ -492,6 +494,7 @@ e_sys_action_do(E_Sys_Action a, char *param)
492 break; 494 break;
493 } 495 }
494 496
497 printf("SSS: e_sys_ction_do ret=%i a=%i\n", ret, _e_sys_action_current);
495 if (ret) _e_sys_action_current = a; 498 if (ret) _e_sys_action_current = a;
496 else _e_sys_action_current = E_SYS_NONE; 499 else _e_sys_action_current = E_SYS_NONE;
497 500
@@ -512,6 +515,7 @@ e_sys_action_raw_do(E_Sys_Action a, char *param)
512 515
513 ret = _e_sys_action_do(a, param, EINA_TRUE); 516 ret = _e_sys_action_do(a, param, EINA_TRUE);
514 517
518 printf("SSS: e_sys_ction_raw_do ret=%i a=%i\n", ret, _e_sys_action_current);
515 if (ret) _e_sys_action_current = a; 519 if (ret) _e_sys_action_current = a;
516 else _e_sys_action_current = E_SYS_NONE; 520 else _e_sys_action_current = E_SYS_NONE;
517 521
@@ -669,9 +673,11 @@ _e_sys_systemd_hibernate(void)
669static Eina_Bool 673static Eina_Bool
670_e_sys_resume_delay(void *d EINA_UNUSED) 674_e_sys_resume_delay(void *d EINA_UNUSED)
671{ 675{
676 printf("SSS: hib check resume delay...\n");
672 _e_sys_resume_delay_timer = NULL; 677 _e_sys_resume_delay_timer = NULL;
673 if (_e_sys_suspended) 678 if (_e_sys_suspended)
674 { 679 {
680 printf("SSS: suspended to false\n");
675 _e_sys_suspended = EINA_FALSE; 681 _e_sys_suspended = EINA_FALSE;
676 ecore_event_add(E_EVENT_SYS_RESUME, NULL, NULL, NULL); 682 ecore_event_add(E_EVENT_SYS_RESUME, NULL, NULL, NULL);
677 _e_sys_comp_resume(); 683 _e_sys_comp_resume();
@@ -687,6 +693,7 @@ _e_sys_susp_hib_check_timer_cb(void *data EINA_UNUSED)
687 printf("SSS: hib check @%1.8f (unix %1.8f, delt %1.8f)\n", ecore_time_get(), t, t - _e_sys_susp_hib_check_last_tick); 693 printf("SSS: hib check @%1.8f (unix %1.8f, delt %1.8f)\n", ecore_time_get(), t, t - _e_sys_susp_hib_check_last_tick);
688 if ((t - _e_sys_susp_hib_check_last_tick) > 0.5) 694 if ((t - _e_sys_susp_hib_check_last_tick) > 0.5)
689 { 695 {
696 printf("SSS: hib check long gap\n");
690 _e_sys_susp_hib_check_timer = NULL; 697 _e_sys_susp_hib_check_timer = NULL;
691 if (_e_sys_resume_delay_timer) 698 if (_e_sys_resume_delay_timer)
692 ecore_timer_del(_e_sys_resume_delay_timer); 699 ecore_timer_del(_e_sys_resume_delay_timer);
@@ -865,6 +872,7 @@ after:
865static void 872static void
866_e_sys_logout_after(void) 873_e_sys_logout_after(void)
867{ 874{
875 printf("SSS: sys action after %i\n", _e_sys_action_after);
868 _e_sys_action_current = _e_sys_action_after; 876 _e_sys_action_current = _e_sys_action_after;
869 _e_sys_action_do(_e_sys_action_after, NULL, _e_sys_action_after_raw); 877 _e_sys_action_do(_e_sys_action_after, NULL, _e_sys_action_after_raw);
870 _e_sys_action_after = E_SYS_NONE; 878 _e_sys_action_after = E_SYS_NONE;
@@ -993,6 +1001,7 @@ _e_sys_action_do(E_Sys_Action a, char *param EINA_UNUSED, Eina_Bool raw)
993 { 1001 {
994 e_fm2_die(); 1002 e_fm2_die();
995 ecore_main_loop_quit(); 1003 ecore_main_loop_quit();
1004 ret = 1;
996 } 1005 }
997 else 1006 else
998 return 0; 1007 return 0;
@@ -1007,6 +1016,7 @@ _e_sys_action_do(E_Sys_Action a, char *param EINA_UNUSED, Eina_Bool raw)
1007 e_fm2_die(); 1016 e_fm2_die();
1008 restart = 1; 1017 restart = 1;
1009 ecore_main_loop_quit(); 1018 ecore_main_loop_quit();
1019 ret = 1;
1010 } 1020 }
1011 else 1021 else
1012 { 1022 {
@@ -1048,10 +1058,8 @@ _e_sys_action_do(E_Sys_Action a, char *param EINA_UNUSED, Eina_Bool raw)
1048 if (systemd_works) 1058 if (systemd_works)
1049 _e_sys_systemd_poweroff(); 1059 _e_sys_systemd_poweroff();
1050 else 1060 else
1051 { 1061 e_system_send("power-halt", NULL);
1052 e_system_send("power-halt", NULL); 1062 ret = 1;
1053 ret = 1;
1054 }
1055 } 1063 }
1056 else 1064 else
1057 { 1065 {
@@ -1075,18 +1083,14 @@ _e_sys_action_do(E_Sys_Action a, char *param EINA_UNUSED, Eina_Bool raw)
1075 if (systemd_works) 1083 if (systemd_works)
1076 _e_sys_systemd_reboot(); 1084 _e_sys_systemd_reboot();
1077 else 1085 else
1078 { 1086 e_system_send("power-reboot", NULL);
1079 e_system_send("power-reboot", NULL);
1080 ret = 1;
1081 }
1082 } 1087 }
1083 else 1088 else
1084 { 1089 {
1085 ret = 0;
1086 _e_sys_begin_time = ecore_time_get(); 1090 _e_sys_begin_time = ecore_time_get();
1087 _e_sys_logout_begin(a, EINA_TRUE); 1091 _e_sys_logout_begin(a, EINA_TRUE);
1088 } 1092 }
1089 /* FIXME: display reboot status */ 1093 ret = 1;
1090 } 1094 }
1091 break; 1095 break;
1092 1096
@@ -1112,8 +1116,8 @@ _e_sys_action_do(E_Sys_Action a, char *param EINA_UNUSED, Eina_Bool raw)
1112 { 1116 {
1113 _e_sys_susp_hib_check(); 1117 _e_sys_susp_hib_check();
1114 e_system_send("power-suspend", NULL); 1118 e_system_send("power-suspend", NULL);
1115 ret = 1;
1116 } 1119 }
1120 ret = 1;
1117 } 1121 }
1118 else 1122 else
1119 { 1123 {
@@ -1162,8 +1166,8 @@ _e_sys_action_do(E_Sys_Action a, char *param EINA_UNUSED, Eina_Bool raw)
1162 { 1166 {
1163 _e_sys_susp_hib_check(); 1167 _e_sys_susp_hib_check();
1164 e_system_send("power-hibernate", NULL); 1168 e_system_send("power-hibernate", NULL);
1165 ret = 1;
1166 } 1169 }
1170 ret = 1;
1167 } 1171 }
1168 else 1172 else
1169 { 1173 {