author | harlekin <harlekin> | 2002-03-18 21:28:36 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-03-18 21:28:36 (UTC) |
commit | d41e6d2ed4caeabf78ab08bde7d4f5866c9eeb04 (patch) (unidiff) | |
tree | ed3c5c8d2eea0001b954a34ecb4a496fa9a6a484 | |
parent | e6d3c651634eee7ff54675cc060ae94bd3ef41bd (diff) | |
download | opie-d41e6d2ed4caeabf78ab08bde7d4f5866c9eeb04.zip opie-d41e6d2ed4caeabf78ab08bde7d4f5866c9eeb04.tar.gz opie-d41e6d2ed4caeabf78ab08bde7d4f5866c9eeb04.tar.bz2 |
tweaked the suspend code a bit, maybe with a delay it works better
-rw-r--r-- | core/launcher/desktop.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index 680cc06..547daa9 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp | |||
@@ -544,41 +544,44 @@ static void darkScreen() | |||
544 | { | 544 | { |
545 | extern void qpe_setBacklight(int); | 545 | extern void qpe_setBacklight(int); |
546 | qpe_setBacklight(0); // force off | 546 | qpe_setBacklight(0); // force off |
547 | } | 547 | } |
548 | 548 | ||
549 | 549 | ||
550 | void Desktop::togglePower() | 550 | void Desktop::togglePower() |
551 | { | 551 | { |
552 | bool wasloggedin = loggedin; | 552 | bool wasloggedin = loggedin; |
553 | loggedin=0; | 553 | loggedin=0; |
554 | darkScreen(); | 554 | darkScreen(); |
555 | if ( wasloggedin ) | 555 | if ( wasloggedin ) |
556 | blankScreen(); | 556 | blankScreen(); |
557 | 557 | ||
558 | system("apm --suspend"); | 558 | system("apm --suspend"); |
559 | 559 | ||
560 | sleep(2); | ||
561 | |||
560 | QWSServer::screenSaverActivate( FALSE ); | 562 | QWSServer::screenSaverActivate( FALSE ); |
561 | { | 563 | { |
562 | QCopEnvelope("QPE/Card", "mtabChanged()" ); // might have changed while asleep | 564 | QCopEnvelope("QPE/Card", "mtabChanged()" ); // might have changed while asleep |
563 | QCopEnvelope e("QPE/System", "setBacklight(int)"); | 565 | QCopEnvelope e("QPE/System", "setBacklight(int)"); |
564 | e << -3; // Force on | 566 | e << -3; // Force on |
565 | } | 567 | } |
566 | if ( wasloggedin ) { | 568 | if ( wasloggedin ) { |
567 | login(TRUE); | 569 | login(TRUE); |
568 | } | 570 | } |
571 | |||
569 | execAutoStart(); | 572 | execAutoStart(); |
570 | //qcopBridge->closeOpenConnections(); | 573 | //qcopBridge->closeOpenConnections(); |
571 | //qDebug("called togglePower()!!!!!!"); | 574 | //qDebug("called togglePower()!!!!!!"); |
572 | } | 575 | } |
573 | 576 | ||
574 | void Desktop::toggleLight() | 577 | void Desktop::toggleLight() |
575 | { | 578 | { |
576 | QCopEnvelope e("QPE/System", "setBacklight(int)"); | 579 | QCopEnvelope e("QPE/System", "setBacklight(int)"); |
577 | e << -2; // toggle | 580 | e << -2; // toggle |
578 | } | 581 | } |
579 | 582 | ||
580 | void Desktop::toggleSymbolInput() | 583 | void Desktop::toggleSymbolInput() |
581 | { | 584 | { |
582 | tb->toggleSymbolInput(); | 585 | tb->toggleSymbolInput(); |
583 | } | 586 | } |
584 | 587 | ||