summaryrefslogtreecommitdiff
path: root/core/launcher/desktop.cpp
authorsandman <sandman>2002-10-17 00:39:31 (UTC)
committer sandman <sandman>2002-10-17 00:39:31 (UTC)
commit259d10f40405fd77ba0a8947782f716be94da3a5 (patch) (unidiff)
tree636cb3a899d27a8fe41f377fabc5bd170a74c6dc /core/launcher/desktop.cpp
parent5d28c61d84da1814d356540b557bbfe026da98aa (diff)
downloadopie-259d10f40405fd77ba0a8947782f716be94da3a5.zip
opie-259d10f40405fd77ba0a8947782f716be94da3a5.tar.gz
opie-259d10f40405fd77ba0a8947782f716be94da3a5.tar.bz2
- fix for bug #292 (Improper behaviour of frontlight disabling)
- fix for bug #199 (Desktop visible on resume before password dialog appears)
Diffstat (limited to 'core/launcher/desktop.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp34
1 files changed, 23 insertions, 11 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index 0e60839..d74b745 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -181,7 +181,7 @@ public:
181 m_lcd_status = true; 181 m_lcd_status = true;
182 } 182 }
183 183
184 setBacklight ( -3 ); 184 setBacklight ( -1 );
185 } 185 }
186 bool save( int level ) 186 bool save( int level )
187 { 187 {
@@ -332,12 +332,14 @@ void DesktopApplication::switchLCD ( bool on )
332 DesktopApplication *dapp = (DesktopApplication *) qApp; 332 DesktopApplication *dapp = (DesktopApplication *) qApp;
333 333
334 if ( dapp-> m_screensaver ) { 334 if ( dapp-> m_screensaver ) {
335 if ( on ) 335 if ( on ) {
336 dapp-> m_screensaver-> restore ( ); //setBacklight ( on ? -3 : -1 ); 336 dapp-> m_screensaver-> setDisplayState ( true );
337 else 337 dapp-> m_screensaver-> setBacklight ( -3 );
338 dapp-> m_screensaver-> save ( 1 ); 338 }
339 339 else {
340 } 340 dapp-> m_screensaver-> setDisplayState ( false );
341 }
342 }
341 } 343 }
342} 344}
343 345
@@ -862,7 +864,7 @@ void Desktop::togglePower()
862 qDebug ( "togglePower (locked == %d)", excllock ? 1 : 0 ); 864 qDebug ( "togglePower (locked == %d)", excllock ? 1 : 0 );
863 865
864 if ( excllock ) 866 if ( excllock )
865 return ; 867 return;
866 868
867 excllock = true; 869 excllock = true;
868 870
@@ -870,17 +872,27 @@ void Desktop::togglePower()
870 loggedin = 0; 872 loggedin = 0;
871 suspendTime = QDateTime::currentDateTime(); 873 suspendTime = QDateTime::currentDateTime();
872 874
873 ODevice::inst ( ) -> suspend ( ); 875#ifdef QWS
876 if ( Password::needToAuthenticate ( true ) && qt_screen ) {
877 // Should use a big black window instead.
878 // But this would not show up fast enough
879 QGfx *g = qt_screen-> screenGfx ( );
880 g-> fillRect ( 0, 0, qt_screen-> width ( ), qt_screen-> height ( ));
881 delete g;
882 }
883#endif
884
885 ODevice::inst ( )-> suspend ( );
874 886
875 QWSServer::screenSaverActivate ( false );
876 DesktopApplication::switchLCD ( true ); // force LCD on without slow qcop call 887 DesktopApplication::switchLCD ( true ); // force LCD on without slow qcop call
888 QWSServer::screenSaverActivate ( false );
877 889
878 { 890 {
879 QCopEnvelope( "QPE/Card", "mtabChanged()" ); // might have changed while asleep 891 QCopEnvelope( "QPE/Card", "mtabChanged()" ); // might have changed while asleep
880 } 892 }
881 893
882 if ( wasloggedin ) 894 if ( wasloggedin )
883 login( TRUE ); 895 login ( true );
884 896
885 execAutoStart(); 897 execAutoStart();
886 //qcopBridge->closeOpenConnections(); 898 //qcopBridge->closeOpenConnections();