-rw-r--r-- | core/launcher/desktop.cpp | 12 | ||||
-rw-r--r-- | libopie/odevice.cpp | 4 |
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 | |||
@@ -601,34 +601,38 @@ static void darkScreen() | |||
601 | qpe_setBacklight(0); // force off | 601 | qpe_setBacklight(0); // force off |
602 | } | 602 | } |
603 | 603 | ||
604 | 604 | ||
605 | void Desktop::togglePower() | 605 | void Desktop::togglePower() |
606 | { | 606 | { |
607 | extern void qpe_setBacklight ( int ); // We need to toggle the LCD fast - no time to send a QCop | ||
608 | |||
607 | static bool excllock = false; | 609 | static bool excllock = false; |
608 | 610 | ||
609 | if ( excllock ) | 611 | if ( excllock ) |
610 | return; | 612 | return; |
611 | 613 | ||
612 | excllock = true; | 614 | excllock = true; |
613 | 615 | ||
614 | bool wasloggedin = loggedin; | 616 | bool wasloggedin = loggedin; |
615 | loggedin=0; | 617 | loggedin=0; |
616 | suspendTime = QDateTime::currentDateTime(); | 618 | suspendTime = QDateTime::currentDateTime(); |
617 | darkScreen(); | 619 | |
620 | qpe_setBacklight ( 0 ); // force LCD off | ||
621 | |||
618 | if ( wasloggedin ) | 622 | if ( wasloggedin ) |
619 | blankScreen(); | 623 | blankScreen(); |
620 | 624 | ||
621 | ODevice::inst ( )-> suspend ( ); | 625 | ODevice::inst ( )-> suspend ( ); |
622 | 626 | ||
623 | QWSServer::screenSaverActivate( FALSE ); | 627 | QWSServer::screenSaverActivate ( false ); |
628 | |||
629 | qpe_setBacklight ( -3 ); // force LCD on | ||
624 | 630 | ||
625 | { | 631 | { |
626 | QCopEnvelope("QPE/Card", "mtabChanged()" ); // might have changed while asleep | 632 | QCopEnvelope("QPE/Card", "mtabChanged()" ); // might have changed while asleep |
627 | QCopEnvelope e("QPE/System", "setBacklight(int)"); | ||
628 | e << -3; // Force on | ||
629 | } | 633 | } |
630 | 634 | ||
631 | if ( wasloggedin ) | 635 | if ( wasloggedin ) |
632 | login(TRUE); | 636 | login(TRUE); |
633 | 637 | ||
634 | execAutoStart(); | 638 | execAutoStart(); |
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index 057c344..bf64676 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp | |||
@@ -303,13 +303,14 @@ void ODeviceIPAQ::tstp_sighandler ( int ) | |||
303 | 303 | ||
304 | bool ODeviceIPAQ::suspend ( ) | 304 | bool ODeviceIPAQ::suspend ( ) |
305 | { | 305 | { |
306 | int fd; | 306 | int fd; |
307 | bool res = false; | 307 | bool res = false; |
308 | 308 | ||
309 | if (( fd = ::open ( "/dev/apm_bios", O_RDWR )) >= 0 ) { | 309 | if ((( fd = ::open ( "/dev/apm_bios", O_RDWR )) >= 0 ) || |
310 | (( fd = ::open ( "/dev/misc/apm_bios",O_RDWR )) >= 0 )) { | ||
310 | struct timeval tvs, tvn; | 311 | struct timeval tvs, tvn; |
311 | 312 | ||
312 | ::signal ( SIGTSTP, tstp_sighandler ); | 313 | ::signal ( SIGTSTP, tstp_sighandler ); |
313 | ::gettimeofday ( &tvs, 0 ); | 314 | ::gettimeofday ( &tvs, 0 ); |
314 | 315 | ||
315 | res = ( ::ioctl ( fd, APM_IOC_SUSPEND ) == 0 ); | 316 | res = ( ::ioctl ( fd, APM_IOC_SUSPEND ) == 0 ); |
@@ -325,12 +326,13 @@ bool ODeviceIPAQ::suspend ( ) | |||
325 | 326 | ||
326 | ::kill ( -::getpid ( ), SIGCONT ); | 327 | ::kill ( -::getpid ( ), SIGCONT ); |
327 | } | 328 | } |
328 | 329 | ||
329 | ::signal ( SIGTSTP, SIG_DFL ); | 330 | ::signal ( SIGTSTP, SIG_DFL ); |
330 | } | 331 | } |
332 | |||
331 | return res; | 333 | return res; |
332 | } | 334 | } |
333 | 335 | ||
334 | 336 | ||
335 | void ODeviceIPAQ::alarmSound ( ) | 337 | void ODeviceIPAQ::alarmSound ( ) |
336 | { | 338 | { |