summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/desktop.cpp12
-rw-r--r--libopie/odevice.cpp4
2 files changed, 11 insertions, 5 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index 7f24259..552c7c3 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -604,6 +604,8 @@ static void darkScreen()
void Desktop::togglePower()
{
+ extern void qpe_setBacklight ( int ); // We need to toggle the LCD fast - no time to send a QCop
+
static bool excllock = false;
if ( excllock )
@@ -614,18 +616,20 @@ void Desktop::togglePower()
bool wasloggedin = loggedin;
loggedin=0;
suspendTime = QDateTime::currentDateTime();
- darkScreen();
+
+ qpe_setBacklight ( 0 ); // force LCD off
+
if ( wasloggedin )
blankScreen();
ODevice::inst ( )-> suspend ( );
- QWSServer::screenSaverActivate( FALSE );
+ QWSServer::screenSaverActivate ( false );
+
+ qpe_setBacklight ( -3 ); // force LCD on
{
QCopEnvelope("QPE/Card", "mtabChanged()" ); // might have changed while asleep
- QCopEnvelope e("QPE/System", "setBacklight(int)");
- e << -3; // Force on
}
if ( wasloggedin )
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp
index 057c344..bf64676 100644
--- a/libopie/odevice.cpp
+++ b/libopie/odevice.cpp
@@ -306,7 +306,8 @@ bool ODeviceIPAQ::suspend ( )
int fd;
bool res = false;
- if (( fd = ::open ( "/dev/apm_bios", O_RDWR )) >= 0 ) {
+ if ((( fd = ::open ( "/dev/apm_bios", O_RDWR )) >= 0 ) ||
+ (( fd = ::open ( "/dev/misc/apm_bios",O_RDWR )) >= 0 )) {
struct timeval tvs, tvn;
::signal ( SIGTSTP, tstp_sighandler );
@@ -328,6 +329,7 @@ bool ODeviceIPAQ::suspend ( )
::signal ( SIGTSTP, SIG_DFL );
}
+
return res;
}