raster pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=7faf6666e53b8e524b2158246079e772557a07ac

commit 7faf6666e53b8e524b2158246079e772557a07ac
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Sun Feb 22 17:50:12 2015 +0900

    e - actions - smart suspend/hibernate - also dont do when on mains power
---
 src/bin/e_actions.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/bin/e_actions.c b/src/bin/e_actions.c
index dcf5158..9596962 100644
--- a/src/bin/e_actions.c
+++ b/src/bin/e_actions.c
@@ -2393,7 +2393,8 @@ _have_lid_and_external_screens_on(void)
 
 ACT_FN_GO(suspend_smart, __UNUSED__)
 {
-   if (!_have_lid_and_external_screens_on())
+   if ((!_have_lid_and_external_screens_on()) &&
+       (ecore_power_state_get() != ECORE_POWER_STATE_MAINS))
      e_sys_action_do(E_SYS_SUSPEND, NULL);
 }
 
@@ -2461,7 +2462,8 @@ ACT_FN_GO(hibernate, )
 
 ACT_FN_GO(hibernate_smart, __UNUSED__)
 {
-   if (!_have_lid_and_external_screens_on())
+   if ((!_have_lid_and_external_screens_on()) &&
+       (ecore_power_state_get() != ECORE_POWER_STATE_MAINS))
      e_sys_action_do(E_SYS_HIBERNATE, NULL);
 }
 

-- 


Reply via email to