summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-08-25 17:57:31 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-08-25 17:57:31 -0500
commitf956245ca27cd01a855f8951237ba4c63456c974 (patch)
tree319635f166e41a86723d9883dc570b481440da48 /src
parent67312e92f2ed5347f42bfa8e535102f9a930a801 (diff)
downloadtdepowersave-f956245ca27cd01a855f8951237ba4c63456c974.tar.gz
tdepowersave-f956245ca27cd01a855f8951237ba4c63456c974.zip
Fix failure to reenter suspend/standby
This relates to Bug 1597
Diffstat (limited to 'src')
-rw-r--r--src/hardware.cpp8
-rw-r--r--src/tdepowersave.cpp2
2 files changed, 9 insertions, 1 deletions
diff --git a/src/hardware.cpp b/src/hardware.cpp
index 48d7c64..c0aded6 100644
--- a/src/hardware.cpp
+++ b/src/hardware.cpp
@@ -916,7 +916,11 @@ bool HardwareInfo::suspend( suspend_type suspend ) {
if (suspend_states.suspend2disk && (suspend_states.suspend2disk_allowed != 0)) {
if (rdevice->setPowerState(TDESystemPowerState::Hibernate)) {
calledSuspend.start();
+ handleResumeSignal(0);
return true;
+ } else {
+ handleResumeSignal(-1);
+ return false;
}
} else {
if ( !suspend_states.suspend2disk )
@@ -931,8 +935,10 @@ bool HardwareInfo::suspend( suspend_type suspend ) {
if (suspend_states.suspend2ram && (suspend_states.suspend2ram_allowed != 0)) {
if (rdevice->setPowerState(TDESystemPowerState::Suspend)) {
calledSuspend.start();
+ handleResumeSignal(0);
return true;
} else {
+ handleResumeSignal(-1);
return false;
}
} else {
@@ -948,8 +954,10 @@ bool HardwareInfo::suspend( suspend_type suspend ) {
if (suspend_states.standby && (suspend_states.standby_allowed != 0)) {
if (rdevice->setPowerState(TDESystemPowerState::Standby)) {
calledSuspend.start();
+ handleResumeSignal(0);
return true;
} else {
+ handleResumeSignal(-1);
return false;
}
} else {
diff --git a/src/tdepowersave.cpp b/src/tdepowersave.cpp
index 2c3dfce..c1086e4 100644
--- a/src/tdepowersave.cpp
+++ b/src/tdepowersave.cpp
@@ -1150,7 +1150,7 @@ void tdepowersave::handleSleepButtonEvent() {
/*!
* Handle the event for the suspend2disk (hibernater) button and call the related action.
*/
-void tdepowersave::handleS2DiskButtonEvent(){
+void tdepowersave::handleS2DiskButtonEvent() {
kdDebugFuncIn(trace);
// Only go to suspend on button event if we already resumed successful.