discuss-gnustep
[Top][All Lists]
Advanced

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

Re: [NSWorkspace launchedApplications] issue


From: Truls Becken
Subject: Re: [NSWorkspace launchedApplications] issue
Date: Thu, 2 Aug 2007 08:52:52 +0200

On 8/1/07, Andreas Höschler <ahoesch@smartsoft.de> wrote:
> Hi all,
>
> as the name implies launchedApplications is supposed to return only
> launched applications. On MacOSX this works as expected. Under GNUstep
> (also with the latest release) I get the full set of installed
> applications (whether they are running or not).
>
> Is there a workaround for this bug? Is see that determining this list
> is no easy task since it requires some kind of registration mechanism.
> What's the current approach in GNUstep for doing that?
>
> I just found some GSDock sources that work ok on MacOSX but not at all
> under GNUstep, mainly because GSDock is based on this
> launchedApplications method of NSWorkspace which seems to be broken in
> GNUstep.

The documentation for launchedApplications warns that the result is
not guaranteed to be up to date. As Yen-Ju mentioned, this is mainly
because crashed applications don't notify NSWorkspace when they
terminate.

That being said, when I have experimented with launchedApplications on
earlier releases, it has worked as documented. It has given
satisfactory results, except when I have killed applications in some
kind of rude way. You should therefore feel free to file a bug report
about getting all installed applications.

It would also be nice if NSWorkspace in some way managed to always
know the correct set of running applications, but I guess that would
require some kind of probing which would affect performance. And not
only when someone asks what is running, but periodically as it's
possible to receive notifications when apps launch or terminate. Since
NSWorkspace knows the PID for each application, checking whether the
process still exists might be good enough.

reply via email to

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