summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp35
1 files changed, 31 insertions, 4 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index c154689..ba9db71 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -330,2 +330,4 @@ class QPEScreenSaver : public QWSScreenSaver
330{ 330{
331private:
332 int LcdOn;
331 333
@@ -334,2 +336,8 @@ public:
334 { 336 {
337 int fd;
338
339 LcdOn = TRUE;
340 // Make sure the LCD is in fact on, (if opie was killed while the LCD is off it would still be off)
341 fd=open("/dev/fb0",O_RDWR);
342 if (fd != -1) { ioctl(fd,FBIOBLANK,VESA_NO_BLANKING); close(fd); }
335 } 343 }
@@ -337,2 +345,8 @@ public:
337 { 345 {
346 if (!LcdOn) // We must have turned it off
347 {
348 int fd;
349 fd=open("/dev/fb0",O_RDWR);
350 if (fd != -1) { ioctl(fd,FBIOBLANK,VESA_NO_BLANKING); close(fd); }
351 }
338 setBacklight(-1); 352 setBacklight(-1);
@@ -341,2 +355,4 @@ public:
341 { 355 {
356 int fd;
357
342 switch ( level ) { 358 switch ( level ) {
@@ -356,6 +372,17 @@ public:
356 case 2: 372 case 2:
357 if ( disable_suspend > 2 && !powerOnline() && !networkOnline() ) { 373 Config config( "qpe" );
358 QWSServer::sendKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE ); 374 config.setGroup( "Screensaver" );
359 return TRUE; 375 if (config.readNumEntry("LcdOffOnly",0) != 0) // We're only turning off the LCD
360 } 376 {
377 fd=open("/dev/fb0",O_RDWR);
378 if (fd != -1) { ioctl(fd,FBIOBLANK,VESA_POWERDOWN); close(fd); }
379 LcdOn = FALSE;
380 }
381 else // We're going to suspend the whole machine
382 {
383 if ( disable_suspend > 2 && !powerOnline() && !networkOnline() ) {
384 QWSServer::sendKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE );
385 return TRUE;
386 }
387 }
361 break; 388 break;