bug-gnustep
[Top][All Lists]
Advanced

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

Re: NSWorkspace launchedApplications method


From: Alexander Malmberg
Subject: Re: NSWorkspace launchedApplications method
Date: Wed, 18 Jun 2003 17:00:46 +0200

Matt Rice wrote:
[snip]
> > Is there 
> > anyway to combine it with something else?
> 
> well there's gdnc which belongs to base.
> Fred already addressed this though.
> attached is a patch and a test thing anyways..

Well, apart from not having anything to do with -base, adding unrelated
functionality to basic daemons is a bad thing (they should do one thing,
and do it well; this is especially important for setuid daemons like
gdomap).

> > Maybe just using gdnc to
> > spread the information around?
> 
> maybe i'm misunderstanding,

Each app has a local array of launched apps. When an app firsts calls
-launchedApplications, the apps sends out a GSApplicationPing
notification (or something), and other apps respond with a
GSApplicationIsRunning (or something). This way, the app knows which
apps are running. From that point, the array can be kept up to date by
observing the normal application notifications.

[snip]
> just seemed to me like strange workarounds to have
> instead of having something which would just listen
> for the notifications

Well, this is what you get when you try to add desktop functionality to
something that isn't a desktop.

> and another thing not addressed in the appinfod (nor
> this patch) is if something crashes we'd probably want
> to make it have some NSTimer connect to the apps and
> if need be remove them from the list... doing it this
> way if this happened without some app checking on that
> "master" app seems like it could jeopordize the
> contents of the array

This is not a problem. There's no synchronized way of using
-launchedApplications, so the results might be invalid by the time the
caller gets them (another app might start, quit, or crash between the
call and the use of the return value). Thus, callers have to deal with
apps that might not be running anymore anyway, and there's no reason to
or way of dealing with it in -launchedApplications.

[snip]
> all good points, I'm not very firmiliar with.
> I think another issue is multiple users on the same
> host

Using NSMessagePort, there shouldn't be any problems. If necessary, I
can test here if someone implements the GSApplicationPing/... system.

- Alexander Malmberg




reply via email to

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