e - actions - smart suspend/hibernate - also dont do when on mains power
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sun, 22 Feb 2015 08:50:12 +0000 (17:50 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Mon, 23 Feb 2015 03:11:50 +0000 (12:11 +0900)
src/bin/e_actions.c

index dcf515814c4e46fa2f467d47788ba474ad504038..9596962b4c22c784fe7b4f227e0a681d338e5530 100644 (file)
@@ -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);
 }