thanatermesis pushed a commit to branch enlightenment-0.17. http://git.enlightenment.org/core/enlightenment.git/commit/?id=36ff6cfb479472b40243f65d01b6878a2cfe25f7
commit 36ff6cfb479472b40243f65d01b6878a2cfe25f7 Author: Sebastian Dransfeld <[email protected]> Date: Fri Mar 1 11:14:58 2013 +0100 Fix hibernate (cherry picked from commit 79fba3fa9a0424c6441896e78633a2521bd4e717) Conflicts: ChangeLog src/bin/e_sys.c (cherry picked from commit 857bf87b7b17da1a1b361d9a6faac19d7ba674ec) Conflicts: ChangeLog --- ChangeLog | 4 ++++ src/bin/e_sys.c | 55 +++++++++++++++++++++++++++---------------------------- 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index 18ff87b..39a6bc2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-03-01 Sebastian Dransfeld + + * Fix sys hibernate by checking raw condition first + 2015-03-25 Samuel F. Baggen (Thanatermesis) * included improvement in XDG_DATA_DIRS by zmike diff --git a/src/bin/e_sys.c b/src/bin/e_sys.c index 82377a9..58e6e28 100644 --- a/src/bin/e_sys.c +++ b/src/bin/e_sys.c @@ -35,12 +35,12 @@ static E_Obj_Dialog *_e_sys_dialog = NULL; static E_Dialog *_e_sys_logout_confirm_dialog = NULL; static Ecore_Timer *_e_sys_susp_hib_check_timer = NULL; static double _e_sys_susp_hib_check_last_tick = 0.0; -static void (*_e_sys_suspend_func) (void) = NULL; -static void (*_e_sys_hibernate_func) (void) = NULL; -static void (*_e_sys_reboot_func) (void) = NULL; -static void (*_e_sys_shutdown_func) (void) = NULL; -static void (*_e_sys_logout_func) (void) = NULL; -static void (*_e_sys_resume_func) (void) = NULL; +static void (*_e_sys_suspend_func)(void) = NULL; +static void (*_e_sys_hibernate_func)(void) = NULL; +static void (*_e_sys_reboot_func)(void) = NULL; +static void (*_e_sys_shutdown_func)(void) = NULL; +static void (*_e_sys_logout_func)(void) = NULL; +static void (*_e_sys_resume_func)(void) = NULL; static const int E_LOGOUT_AUTO_TIME = 60; static const int E_LOGOUT_WAIT_TIME = 15; @@ -237,12 +237,12 @@ e_sys_con_extra_action_list_get(void) } EAPI void -e_sys_handlers_set(void (*suspend_func) (void), - void (*hibernate_func) (void), - void (*reboot_func) (void), - void (*shutdown_func) (void), - void (*logout_func) (void), - void (*resume_func) (void)) +e_sys_handlers_set(void (*suspend_func)(void), + void (*hibernate_func)(void), + void (*reboot_func)(void), + void (*shutdown_func)(void), + void (*logout_func)(void), + void (*resume_func)(void)) { _e_sys_suspend_func = suspend_func; _e_sys_hibernate_func = hibernate_func; @@ -279,7 +279,7 @@ _e_sys_susp_hib_check(void) if (_e_sys_susp_hib_check_timer) ecore_timer_del(_e_sys_susp_hib_check_timer); _e_sys_susp_hib_check_last_tick = ecore_time_unix_get(); - _e_sys_susp_hib_check_timer = + _e_sys_susp_hib_check_timer = ecore_timer_add(0.1, _e_sys_susp_hib_check_timer_cb, NULL); } @@ -843,9 +843,9 @@ _e_sys_action_do(E_Sys_Action a, char *param __UNUSED__, Eina_Bool raw) { if (e_config->desklock_on_suspend) e_desklock_show(EINA_TRUE); - + _e_sys_susp_hib_check(); - + _e_sys_begin_time = ecore_time_get(); _e_sys_exe = ecore_exe_run(buf, NULL); od = e_obj_dialog_new(e_container_current_get(e_manager_current_get()), @@ -878,30 +878,29 @@ _e_sys_action_do(E_Sys_Action a, char *param __UNUSED__, Eina_Bool raw) } else { - ecore_event_add(E_EVENT_SYS_HIBERNATE, NULL, NULL, NULL); - if (_e_sys_hibernate_func) - { - _e_sys_hibernate_func(); - return 0; - } - else - { if (raw) { + _e_sys_susp_hib_check(); if (e_config->desklock_on_suspend) e_desklock_show(EINA_TRUE); - - _e_sys_susp_hib_check(); _e_sys_begin_time = ecore_time_get(); _e_sys_exe = ecore_exe_run(buf, NULL); + } + else + { + ecore_event_add(E_EVENT_SYS_HIBERNATE, NULL, NULL, NULL); + if (_e_sys_hibernate_func) + { + _e_sys_hibernate_func(); + return 0; } else { if (e_config->desklock_on_suspend) e_desklock_show(EINA_TRUE); - + _e_sys_susp_hib_check(); - + _e_sys_begin_time = ecore_time_get(); _e_sys_exe = ecore_exe_run(buf, NULL); od = e_obj_dialog_new(e_container_current_get(e_manager_current_get()), @@ -926,7 +925,7 @@ _e_sys_action_do(E_Sys_Action a, char *param __UNUSED__, Eina_Bool raw) } return 1; } - + static void _e_sys_dialog_cb_delete(E_Obj_Dialog *od __UNUSED__) { --
