activity switching during logout

Chani chanika at gmail.com
Thu Dec 2 13:48:27 CET 2010


This started out as a review request, but now it makes more sense as an 
email... I'm trying to find a solution and going through lots of wrong answers 
on the way... if you want to skip to the conclusion, it's after the ----.  :)

so... I'm doing it wrong, here, I can feel it. but I can't figure out how to 
do it right - or at least less-wrong.

The problem: on logout, some windows may ask the user about saving changes or 
whatever. this is SessionInteract, and blocks logout until the app is 
satisfied. We need to present these apps to the user so that it doesn't look 
like logout just stalled. Identifying them is a hack itself: we just assume 
it's any new window that appears during logout.

If the app's on another desktop, we hop on over there no problem. if the app's 
on another activity - well, it'd be ok if the activity was open, we'd just 
have to ensure no dbus deadlocks are triggered. But there's a teensy tiny 
chance that the window is on a *closed* activity because it's part of a 
process that's also on some other open activity. In that case, switching to 
the activity would trigger an attempt to open the activity which would fail 
because ksmserver is busy handling the logout. Either you'd be bounced back to 
some other activity, or you'd lose the subsession that would have been 
restored, or maybe both.

Then again, maybe the chance of that is so tiny that I should ignore it and 
just call the switch.
hell, maybe I'm coming at this from the wrong side: the user can trigger this 
manually themselves by trying to switch to a closed activity while some app is 
asking to save. Working around it in kwin wouldn't stop the potential dataloss 
if a user plays with the activitymanager during logout. So really, this should 
be solved in ActivityManager. but how?

The activitymanager needs to know when logout is happening. telling it that a 
load request failed isn't enough - if it failed because another subsession is 
being handled or we're logging in, then it can try again later, but with 
logout there is no later and the SessionInteract app *must* be reachable.

There's no "logging out" signal, as activitymanager isn't a session client. 
however, I could make one. It'd have to come with a cancelled signal too. or I 
could just make an isLoggingOut method, but that can't be cached (dbus 
deadlocks suuuck)

----

What would ActivityManager do, then, if it's asked to do open/close during 
logout?
It can flat-out ignore them, so long as it can handle the current activity 
being closed.  
I worry about how other apps (currently, plasma) might react to that, though. 
And it'd have to do a sanity check on login (although that's a good idea 
anyways).

it's quite the corner case anyways, very unlikely to be triggered.

thoughts?

-- 
Chani
http://chani.ca
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20101202/8074cb9d/attachment.sig 


More information about the Plasma-devel mailing list