discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNUstep and session management


From: Richard Frith-Macdonald
Subject: Re: GNUstep and session management
Date: Sat, 08 Oct 2005 16:31:16 +0000

On 2005-10-08 14:02:45 +0000 Adrian Robert <arobert@cogsci.ucsd.edu> wrote:

> 
> On Oct 8, 2005, at 2:42 AM, Sašo Kiselkov wrote:
> 
>> Quoting Adrian Robert <arobert@cogsci.ucsd.edu>:
>> 
>> 
>>> 
>>> On Oct 7, 2005, at 3:50 PM, Sa&#65533;o Kiselkov wrote:
>>> 
>>>> 
>>>> Let's just stop putting up theories about how it may or may not
>>>> work on OSX and
>>>> instead start designing a way that would work for us.
>>>> 
>>> 
>>> I think we should try to follow OS X behavior to make things easier
>>> for people porting or maintaining cross-platform apps unless there's
>>> something broken in the way OS X does it.  Questions can be settled
>>> easily by running some test code on an OS X box.  I don't have time
>>> to write a test class right now but if someone sends me one I can
>>> compile it and try it out on Panther and Tiger and post the results
>>> here.
>>> 
>> 
>> Why bother following the _internal_workings_ of OSX? The important 
>> features,
>> namely the external interface that apps see (that is, that
>> -applicationShouldTerminate: gets invoked before the poweroff  occurs and 
>> the
>> return value correctly controls poweroff) and which users expect  (correct
>> behavior of the workspace when the app is controlling poweroff) is  already 
>> in
>> the implementation I proposed. My point is: my implementation  _DOES_ 
>> follow the
>> correct OSX app behavior (which in simple terms means "override
>> -applicationShouldTerminate: and you can decide about poweroff with  it"), 
>> but I
>> didn't bother trying to disassemble and backtrace every step OSX  made 
>> about how
>> to implement the feature, and thus a _dirty_ implementation that  relies on 
>> bugs
>> in OSX might (will) not work on GNUstep.
> 
> I apologize, I misunderstood the intent of your proposal.  Now that I  look 
> more closely at your code, I see what I missed (in an admittedly  rushed 
> glance-over) before -- the GS extension methods you mentioned  are fully 
> behind the scenes, not something app writers have to code  specifically to.  
> My bad.

I think this model is wrong ... a logout/shutdown by the  session manager is 
not/should not be subject to application veto.

Rather, the session manager should tell applications to shut down, and the 
applications should be responsible for shutting down cleanly.  The API (of 
NSApplication) allows the application delegate to cancel or defer termination, 
but this does not mean that the session manager has to abide by that.  I'm not 
sure that the GNUstep implementation handles the defer case properly as I've 
never tried it.

So the session manager should IMO wait a while after it told all the 
applications to terminate, then decide what it wants to do about any 
application which has not terminated (it may kill the applications or may 
decide to cancel the logout/shutdown, or it may ask the user to decide).

NB. there is already API to ask the session manager to defer power off ... 
[NSWorkspace-extendPowerOffBy:], and this is not yet implemented in either 
MacOS-X or GNUstep (though perhaps it should be).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]