[Top][All Lists]

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

Re: GWorkspace openFile & ImageViewer

From: Jeff Teunissen
Subject: Re: GWorkspace openFile & ImageViewer
Date: Fri, 11 Apr 2003 06:25:09 -0400

Richard Frith-Macdonald wrote:
> On Wednesday, April 9, 2003, at 02:57  pm, Enrico Sersale wrote:
> >
> > On Wed, 9 Apr 2003, Richard Frith-Macdonald wrote:
> >
> >> Marko Riedel wrote:
> >>
> >>> thanks for those pointers but I have already done exactly what you
> >>> suggest:
> >>>
> >>> (a) implement -application:openFile:
> >>> (b) modify GPSTextInfo.plist
> As a workaround for a gui bug, it looks like you also need to call
> [NSApp activateIgnoringOtherApps: YES];
> in your -application:openFile: implementation to cope with it being
> called when your app is inactive.
> The current CVS code fixes that, but you might want to do the
> workaround so your code will operate correctly with the last
> gui release.

On OPENSTEP, -application:openFile: does not do anything to the app -- it
is not activated.

NSWindow -orderFront: checks whether the app is hidden (and if so, sends
-unhideWithoutActivation), brings the window to the front of its level,
and makes it visible -- in that order. This also means that it is a valid
behavior for windows to be created and ordered front by inactive apps,
meaning that the [NSApp isActive] check in -orderFront: is bogus.
-orderFrontRegardless should rarely be used, as it can place windows in
front of those owned by the active app. It's mostly used when one app is
using another to display something.

NSWindow -orderWindow:NSOrderAbove relativeTo: 0 does the same thing,
unhiding the app if it is hidden -- but again, not activating the app.

To make things interesting, opening a file from the Workspace activates
the app...but opening a file from the command-line does not. :)

This tells me that Workspace does something explicitly to activate apps
that "open" does not.

| Jeff Teunissen  -=-  Pres., Dusk To Dawn Computing  -=-  deek @ d2dc.net
| GPG: 1024D/9840105A   7102 808A 7733 C2F3 097B  161B 9222 DAB8 9840 105A
| Core developer, The QuakeForge Project        http://www.quakeforge.net/
| Specializing in Debian GNU/Linux              http://www.d2dc.net/~deek/

reply via email to

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