-rw-r--r-- | core/launcher/desktop.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index f90da1a..7f24259 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp @@ -604,6 +604,13 @@ static void darkScreen() void Desktop::togglePower() { + static bool excllock = false; + + if ( excllock ) + return; + + excllock = true; + bool wasloggedin = loggedin; loggedin=0; suspendTime = QDateTime::currentDateTime(); @@ -611,23 +618,26 @@ void Desktop::togglePower() if ( wasloggedin ) blankScreen(); - system("apm --suspend"); - - + ODevice::inst ( )-> suspend ( ); QWSServer::screenSaverActivate( FALSE ); + { QCopEnvelope("QPE/Card", "mtabChanged()" ); // might have changed while asleep QCopEnvelope e("QPE/System", "setBacklight(int)"); e << -3; // Force on } - if ( wasloggedin ) { + + if ( wasloggedin ) login(TRUE); - } - sleep(1); + execAutoStart(); //qcopBridge->closeOpenConnections(); //qDebug("called togglePower()!!!!!!"); + + qApp-> processEvents ( ); + + excllock = false; } void Desktop::toggleLight() |