[kde-workspace] /: block until the lock windows are shown; prevents sleeping before locking

Oliver Henshaw oliver.henshaw at gmail.com
Sat Mar 16 16:20:38 UTC 2013


On 15 March 2013 20:37, Aaron J. Seigo <aseigo at kde.org> wrote:
> On Thursday, March 14, 2013 20:21:59 Oliver Henshaw wrote:
>> > diff --git a/ksmserver/screenlocker/ksldapp.cpp
>> > b/ksmserver/screenlocker/ksldapp.cpp index 7f2e671..6a6fad8 100644
>> > --- a/ksmserver/screenlocker/ksldapp.cpp
>> > +++ b/ksmserver/screenlocker/ksldapp.cpp
>> > @@ -277,10 +277,13 @@ bool KSldApp::startLockProcess()
>> >
>> >      }
>> >      m_lockProcess->start();
>> >      // we wait one minute
>> >
>> > -    if (!m_lockProcess->waitForStarted()) {
>> > +    if (m_lockProcess->waitForStarted(60000)) {
>> > +        m_lockProcess->waitForReadyRead(60000);
>>
>> This blocks for 60 seconds.
>
> well, up to 120 seconds in a worst-case scenario.

Testing with the powerdevil "Suspend Action" set to lock the screen.
So it's just an interaction with ksmserver and no subsequent system
suspend:

* Without your patch it only takes a few hundred milliseconds
typically to fully launch the screenlocker and hide the screen.

* With your patch, waitForReadyRead blocks for the full 60 seconds:
the lock process is waiting for a response from ksmserver and
ksmserver is waiting on stdout from the lock process. It must be xsmp
or something, if the greeterapp was blocked on dbus it would time out
after 25 seconds, right?

* If I instead setDelayedReply(true) in
InteInterface::Lock(rface::Lock() and only send the reply to
powerdevil once ksmserver receives lockProcessReady from the
greeterapp then it takes 25 seconds to hide the screen. The greeterapp
now blocks in the Solid::PowerManagement calls in desktopResized until
powerdevil times out waiting for a reply from ksmserver (after 25
seconds).

So this might explain why the screen is sometimes only fully locked
after resuming from suspend:
1. The greeterapp blocks first on ksmserver so doesn't enter
desktopResized until Interface::Lock() returns to the event loop ...
2. ...and then blocks on powerdevil inside desktopResized(). By this
time powerdevil may have triggered the suspend.


More information about the Plasma-devel mailing list