summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--library/qpeapplication.cpp27
1 files changed, 27 insertions, 0 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
{
+private:
+ int LcdOn;
@@ -334,2 +336,8 @@ public:
{
+ int fd;
+
+ LcdOn = TRUE;
+ // Make sure the LCD is in fact on, (if opie was killed while the LCD is off it would still be off)
+ fd=open("/dev/fb0",O_RDWR);
+ if (fd != -1) { ioctl(fd,FBIOBLANK,VESA_NO_BLANKING); close(fd); }
}
@@ -337,2 +345,8 @@ public:
{
+ if (!LcdOn) // We must have turned it off
+ {
+ int fd;
+ fd=open("/dev/fb0",O_RDWR);
+ if (fd != -1) { ioctl(fd,FBIOBLANK,VESA_NO_BLANKING); close(fd); }
+ }
setBacklight(-1);
@@ -341,2 +355,4 @@ public:
{
+ int fd;
+
switch ( level ) {
@@ -356,2 +372,12 @@ public:
case 2:
+ Config config( "qpe" );
+ config.setGroup( "Screensaver" );
+ if (config.readNumEntry("LcdOffOnly",0) != 0) // We're only turning off the LCD
+ {
+ fd=open("/dev/fb0",O_RDWR);
+ if (fd != -1) { ioctl(fd,FBIOBLANK,VESA_POWERDOWN); close(fd); }
+ LcdOn = FALSE;
+ }
+ else // We're going to suspend the whole machine
+ {
if ( disable_suspend > 2 && !powerOnline() && !networkOnline() ) {
@@ -360,2 +386,3 @@ public:
}
+ }
break;