Re: Detecting login/logout?
Re: Detecting login/logout?
- Subject: Re: Detecting login/logout?
- From: Finlay Dobbie <email@hidden>
- Date: Sat, 1 Nov 2003 11:25:19 +0000
On 1 Nov 2003, at 01:04, Wade Tregaskis wrote:
Can anyone point me to any hints at detecting login/logout or any
other good method of knowing when the Mac's login dialog is
onscreen?
SystemConfiguration.framework can notify you when this happens.
However, there are some issues with your application being terminated
with the login session that you might need to look at.
Any idea off hand how the program is terminated? i.e. is it just a
signal that can be caught? I'm looking at doing a similar thing with
a process that needs to run from startup through login/logout cycles.
I cannot rely on individual accounts to have my process set as a login
item, nor would it be convenient to have to handle the closing and
reopening of my process.
Well, you're probably going to have to, as on OS X 10.2 and lower the
windowserver itself respawns on logout. Your application's connection
to the windowserver will be screwed when this happens, and there are no
public APIs for dealing with this (other than requesting a notification
when its mach port dies). Also, on 10.3 and higher, your application
will be bound to a particular CGSession, and so will break with FUS.
You're doing to have to have a daemon which looks out for when these
things happens and spawns your application again at the right times,
methinks.
-- Finlay
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.