author | sandman <sandman> | 2002-08-04 02:25:54 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-08-04 02:25:54 (UTC) |
commit | 8fd0780faa16abbcf7db9220af1bc333ae484ec8 (patch) (unidiff) | |
tree | ffacd596daa0ab07890f185510275667649d55db /core/launcher/desktop.cpp | |
parent | 549df674d7af9fe1347751e6a63d6ed8249d2503 (diff) | |
download | opie-8fd0780faa16abbcf7db9220af1bc333ae484ec8.zip opie-8fd0780faa16abbcf7db9220af1bc333ae484ec8.tar.gz opie-8fd0780faa16abbcf7db9220af1bc333ae484ec8.tar.bz2 |
1) Fixes for suspend/resume (improved it for iPAQ, shouldn't have changed
anything for Z) -- It seems that this also fixes the 70% CPU load
problem (needs more testing/feedback though)
2) the launcher now creates a /var/run/opie.pid file containing its pid
3) the launcher catches SIGTERM and kills all its child processes
-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() | |||
604 | 604 | ||
605 | void Desktop::togglePower() | 605 | void Desktop::togglePower() |
606 | { | 606 | { |
607 | static bool excllock = false; | ||
608 | |||
609 | if ( excllock ) | ||
610 | return; | ||
611 | |||
612 | excllock = true; | ||
613 | |||
607 | bool wasloggedin = loggedin; | 614 | bool wasloggedin = loggedin; |
608 | loggedin=0; | 615 | loggedin=0; |
609 | suspendTime = QDateTime::currentDateTime(); | 616 | suspendTime = QDateTime::currentDateTime(); |
@@ -611,23 +618,26 @@ void Desktop::togglePower() | |||
611 | if ( wasloggedin ) | 618 | if ( wasloggedin ) |
612 | blankScreen(); | 619 | blankScreen(); |
613 | 620 | ||
614 | system("apm --suspend"); | 621 | ODevice::inst ( )-> suspend ( ); |
615 | |||
616 | |||
617 | 622 | ||
618 | QWSServer::screenSaverActivate( FALSE ); | 623 | QWSServer::screenSaverActivate( FALSE ); |
624 | |||
619 | { | 625 | { |
620 | QCopEnvelope("QPE/Card", "mtabChanged()" ); // might have changed while asleep | 626 | QCopEnvelope("QPE/Card", "mtabChanged()" ); // might have changed while asleep |
621 | QCopEnvelope e("QPE/System", "setBacklight(int)"); | 627 | QCopEnvelope e("QPE/System", "setBacklight(int)"); |
622 | e << -3; // Force on | 628 | e << -3; // Force on |
623 | } | 629 | } |
624 | if ( wasloggedin ) { | 630 | |
631 | if ( wasloggedin ) | ||
625 | login(TRUE); | 632 | login(TRUE); |
626 | } | 633 | |
627 | sleep(1); | ||
628 | execAutoStart(); | 634 | execAutoStart(); |
629 | //qcopBridge->closeOpenConnections(); | 635 | //qcopBridge->closeOpenConnections(); |
630 | //qDebug("called togglePower()!!!!!!"); | 636 | //qDebug("called togglePower()!!!!!!"); |
637 | |||
638 | qApp-> processEvents ( ); | ||
639 | |||
640 | excllock = false; | ||
631 | } | 641 | } |
632 | 642 | ||
633 | void Desktop::toggleLight() | 643 | void Desktop::toggleLight() |