-rw-r--r-- | core/launcher/desktop.cpp | 5 | ||||
-rw-r--r-- | core/launcher/main.cpp | 3 |
2 files changed, 3 insertions, 5 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index fb10602..1ec477c 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp | |||
@@ -603,55 +603,52 @@ static void darkScreen() | |||
603 | 603 | ||
604 | void Desktop::togglePower() | 604 | void Desktop::togglePower() |
605 | { | 605 | { |
606 | extern void qpe_setBacklight ( int ); // We need to toggle the LCD fast - no time to send a QCop | 606 | extern void qpe_setBacklight ( int ); // We need to toggle the LCD fast - no time to send a QCop |
607 | 607 | ||
608 | static bool excllock = false; | 608 | static bool excllock = false; |
609 | 609 | ||
610 | if ( excllock ) | 610 | if ( excllock ) |
611 | return; | 611 | return; |
612 | 612 | ||
613 | excllock = true; | 613 | excllock = true; |
614 | 614 | ||
615 | bool wasloggedin = loggedin; | 615 | bool wasloggedin = loggedin; |
616 | loggedin=0; | 616 | loggedin=0; |
617 | suspendTime = QDateTime::currentDateTime(); | 617 | suspendTime = QDateTime::currentDateTime(); |
618 | 618 | ||
619 | qpe_setBacklight ( 0 ); // force LCD off | 619 | //qpe_setBacklight ( 0 ); // force LCD off (sandman: why ????) |
620 | 620 | ||
621 | if ( wasloggedin ) | 621 | if ( wasloggedin ) |
622 | blankScreen(); | 622 | blankScreen(); |
623 | 623 | ||
624 | ODevice::inst ( )-> suspend ( ); | 624 | ODevice::inst ( )-> suspend ( ); |
625 | 625 | ||
626 | QWSServer::screenSaverActivate ( false ); | 626 | QWSServer::screenSaverActivate ( false ); |
627 | 627 | ||
628 | qpe_setBacklight ( -3 ); // force LCD on | 628 | qpe_setBacklight ( -3 ); // force LCD on |
629 | 629 | ||
630 | { | 630 | { |
631 | QCopEnvelope("QPE/Card", "mtabChanged()" ); // might have changed while asleep | 631 | QCopEnvelope("QPE/Card", "mtabChanged()" ); // might have changed while asleep |
632 | } | 632 | } |
633 | 633 | ||
634 | if ( wasloggedin ) | 634 | if ( wasloggedin ) |
635 | login(TRUE); | 635 | login(TRUE); |
636 | 636 | ||
637 | execAutoStart(); | 637 | execAutoStart(); |
638 | //qcopBridge->closeOpenConnections(); | 638 | //qcopBridge->closeOpenConnections(); |
639 | //qDebug("called togglePower()!!!!!!"); | ||
640 | |||
641 | qApp-> processEvents ( ); | ||
642 | 639 | ||
643 | excllock = false; | 640 | excllock = false; |
644 | } | 641 | } |
645 | 642 | ||
646 | void Desktop::toggleLight() | 643 | void Desktop::toggleLight() |
647 | { | 644 | { |
648 | QCopEnvelope e("QPE/System", "setBacklight(int)"); | 645 | QCopEnvelope e("QPE/System", "setBacklight(int)"); |
649 | e << -2; // toggle | 646 | e << -2; // toggle |
650 | } | 647 | } |
651 | 648 | ||
652 | void Desktop::toggleSymbolInput() | 649 | void Desktop::toggleSymbolInput() |
653 | { | 650 | { |
654 | tb->toggleSymbolInput(); | 651 | tb->toggleSymbolInput(); |
655 | } | 652 | } |
656 | 653 | ||
657 | void Desktop::toggleNumLockState() | 654 | void Desktop::toggleNumLockState() |
diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp index 3ee5e26..5cf624b 100644 --- a/core/launcher/main.cpp +++ b/core/launcher/main.cpp | |||
@@ -339,44 +339,45 @@ static const char *pidfile_path = "/var/run/opie.pid"; | |||
339 | 339 | ||
340 | void create_pidfile ( ) | 340 | void create_pidfile ( ) |
341 | { | 341 | { |
342 | FILE *f; | 342 | FILE *f; |
343 | 343 | ||
344 | if (( f = ::fopen ( pidfile_path, "w" ))) { | 344 | if (( f = ::fopen ( pidfile_path, "w" ))) { |
345 | ::fprintf ( f, "%d", getpid ( )); | 345 | ::fprintf ( f, "%d", getpid ( )); |
346 | ::fclose ( f ); | 346 | ::fclose ( f ); |
347 | } | 347 | } |
348 | } | 348 | } |
349 | 349 | ||
350 | void remove_pidfile ( ) | 350 | void remove_pidfile ( ) |
351 | { | 351 | { |
352 | ::unlink ( pidfile_path ); | 352 | ::unlink ( pidfile_path ); |
353 | } | 353 | } |
354 | 354 | ||
355 | void handle_sigterm ( int sig ) | 355 | void handle_sigterm ( int /* sig */ ) |
356 | { | 356 | { |
357 | if ( qApp ) | 357 | if ( qApp ) |
358 | qApp-> quit ( ); | 358 | qApp-> quit ( ); |
359 | } | 359 | } |
360 | 360 | ||
361 | int main( int argc, char ** argv ) | 361 | int main( int argc, char ** argv ) |
362 | { | 362 | { |
363 | #ifndef SINGLE_APP | 363 | #ifndef SINGLE_APP |
364 | ::signal( SIGCHLD, SIG_IGN ); | 364 | ::signal( SIGCHLD, SIG_IGN ); |
365 | 365 | ||
366 | ::signal ( SIGTERM, handle_sigterm ); | 366 | ::signal ( SIGTERM, handle_sigterm ); |
367 | ::signal ( SIGINT, handle_sigterm ); | ||
367 | 368 | ||
368 | ::setsid ( ); | 369 | ::setsid ( ); |
369 | ::setpgid ( 0, 0 ); | 370 | ::setpgid ( 0, 0 ); |
370 | 371 | ||
371 | ::atexit ( remove_pidfile ); | 372 | ::atexit ( remove_pidfile ); |
372 | create_pidfile ( ); | 373 | create_pidfile ( ); |
373 | #endif | 374 | #endif |
374 | 375 | ||
375 | int retVal = initApplication ( argc, argv ); | 376 | int retVal = initApplication ( argc, argv ); |
376 | 377 | ||
377 | #ifndef SINGLE_APP | 378 | #ifndef SINGLE_APP |
378 | // Kill them. Kill them all. | 379 | // Kill them. Kill them all. |
379 | ::kill ( 0, SIGTERM ); | 380 | ::kill ( 0, SIGTERM ); |
380 | ::sleep( 1 ); | 381 | ::sleep( 1 ); |
381 | ::kill ( 0, SIGKILL ); | 382 | ::kill ( 0, SIGKILL ); |
382 | #endif | 383 | #endif |