[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/krunner
From:       Oswald Buddenhagen <ossi () kde ! org>
Date:       2010-10-23 12:45:25
Message-ID: 20101023124525.4CCE9AC89B () svn ! kde ! org
[Download RAW message or body]

SVN commit 1188948 by ossi:

make SimulateUserActivity have an effect even in locked state

that's not mandated by any standard, but whatever ...

FEATURE: 207348
FIXED-IN: 4.6

 M  +17 -2     lock/lockprocess.cc  
 M  +4 -0      screensaver/saverengine.cpp  


--- trunk/KDE/kdebase/workspace/krunner/lock/lockprocess.cc #1188947:1188948
@@ -259,6 +259,12 @@
     ::write( signal_pipe[1], &tmp, 1);
 }
 
+static void sigusr1_handler(int)
+{
+    char tmp = '1';
+    ::write(signal_pipe[1], &tmp, 1);
+}
+
 void LockProcess::timerEvent(QTimerEvent *ev)
 {
     if (ev->timerId() == mAutoLogoutTimerId)
@@ -285,6 +291,9 @@
     // SIGHUP forces lock
     act.sa_handler= sighup_handler;
     sigaction(SIGHUP, &act, 0L);
+    // SIGUSR1 simulates user activity
+    act.sa_handler= sigusr1_handler;
+    sigaction(SIGUSR1, &act, 0L);
 
     pipe(signal_pipe);
     QSocketNotifier* notif = new QSocketNotifier(signal_pipe[0], QSocketNotifier::Read, this);
@@ -296,9 +305,15 @@
 {
     char tmp;
     ::read( signal_pipe[0], &tmp, 1);
-    if( tmp == 'T' )
+    if (tmp == 'T') {
         quitSaver();
-    else if( tmp == 'H' ) {
+    } else if (tmp == '1') {
+        if (!mBusy && mDialogs.isEmpty()) {
+            mBusy = true;
+            quit();
+            mBusy = false;
+        }
+    } else if (tmp == 'H') {
         if( !mLocked )
             startLock();
     }
--- trunk/KDE/kdebase/workspace/krunner/screensaver/saverengine.cpp #1188947:1188948
@@ -154,7 +154,11 @@
     {
         mXAutoLock->resetTrigger();
     }
+    else if (mLockProcess)
+    {
+        ::kill(mLockProcess->pid(), SIGUSR1);
 }
+}
 
 //---------------------------------------------------------------------------
 bool SaverEngine::save()
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic