-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 @@ -587,87 +587,84 @@ static void blankScreen() { if ( !qt_screen ) return; /* Should use a big black window instead. QGfx* g = qt_screen->screenGfx(); g->fillRect(0,0,qt_screen->width(),qt_screen->height()); delete g; */ blanked = TRUE; } static void darkScreen() { extern void qpe_setBacklight(int); qpe_setBacklight(0); // force off } void Desktop::togglePower() { extern void qpe_setBacklight ( int ); // We need to toggle the LCD fast - no time to send a QCop static bool excllock = false; if ( excllock ) return; excllock = true; bool wasloggedin = loggedin; loggedin=0; suspendTime = QDateTime::currentDateTime(); - qpe_setBacklight ( 0 ); // force LCD off +// qpe_setBacklight ( 0 ); // force LCD off (sandman: why ????) if ( wasloggedin ) blankScreen(); ODevice::inst ( )-> suspend ( ); QWSServer::screenSaverActivate ( false ); qpe_setBacklight ( -3 ); // force LCD on { QCopEnvelope("QPE/Card", "mtabChanged()" ); // might have changed while asleep } if ( wasloggedin ) login(TRUE); execAutoStart(); //qcopBridge->closeOpenConnections(); - //qDebug("called togglePower()!!!!!!"); - - qApp-> processEvents ( ); excllock = false; } void Desktop::toggleLight() { QCopEnvelope e("QPE/System", "setBacklight(int)"); e << -2; // toggle } void Desktop::toggleSymbolInput() { tb->toggleSymbolInput(); } void Desktop::toggleNumLockState() { tb->toggleNumLockState(); } void Desktop::toggleCapsLockState() { tb->toggleCapsLockState(); } void Desktop::styleChange( QStyle &s ) { QWidget::styleChange( s ); int displayw = qApp->desktop()->width(); int displayh = qApp->desktop()->height(); QSize sz = tb->sizeHint(); 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 @@ -323,64 +323,65 @@ int initApplication( int argc, char ** argv ) Calibrate *cal = new Calibrate; cal->exec(); delete cal; } #endif d->show(); int rv = a.exec(); delete d; return rv; } static const char *pidfile_path = "/var/run/opie.pid"; void create_pidfile ( ) { FILE *f; if (( f = ::fopen ( pidfile_path, "w" ))) { ::fprintf ( f, "%d", getpid ( )); ::fclose ( f ); } } void remove_pidfile ( ) { ::unlink ( pidfile_path ); } -void handle_sigterm ( int sig ) +void handle_sigterm ( int /* sig */ ) { if ( qApp ) qApp-> quit ( ); } int main( int argc, char ** argv ) { #ifndef SINGLE_APP ::signal( SIGCHLD, SIG_IGN ); ::signal ( SIGTERM, handle_sigterm ); + ::signal ( SIGINT, handle_sigterm ); ::setsid ( ); ::setpgid ( 0, 0 ); ::atexit ( remove_pidfile ); create_pidfile ( ); #endif int retVal = initApplication ( argc, argv ); #ifndef SINGLE_APP // Kill them. Kill them all. ::kill ( 0, SIGTERM ); ::sleep( 1 ); ::kill ( 0, SIGKILL ); #endif return retVal; } |