[opensource-dev] Question about error message

Brandon Husbands xotmid at gmail.com
Tue Sep 21 18:27:31 PDT 2010


IIRC
This is a heads-up message about the use of the FrontWindow API and
compatibility with the next major release of Mac OS X.

In the current version of Mac OS X, the menubar is drawn into a window that
does not have a corresponding WindowRef. The window is actually created with
CoreGraphics window server calls and not by the Carbon Window Manager. The
FrontWindow API never returns a WindowRef for the menubar.

In the next major release of Mac OS X, the Menu Manager will be creating the
menubar window using the Window Manager. The menubar will have a WindowRef.
Since the menubar is almost always the topmost visible window, this means
that the FrontWindow API will almost always return the menubar window, as
will the GetFrontWindowOfClass API when passed the kAllWindowClasses
constant.

FrontWindow has been a deprecated API for most usages since Mac OS 8.5, when
the FrontNonFloatingWindow API and built-in support for floating windows
were introduced. However, a lot of apps are still using it, and get away
with this in most cases because the app doesn't use floating windows itself.
This is no longer going to work.

It's very important to review your source code for uses of the FrontWindow
and GetFrontWindowOfClass APIs. It's perfectly OK to use these APIs if you
really do want the topmost visible window, of whatever kind, perhaps because
you're interating over the window list to examine each window. But if your
code is calling FrontWindow or GetFrontWindowOfClass(kAllWindowClasses) with
the assumption that this will return the active document or dialog window,
then you will have a compatibility problem on the next major release of X.
You will get back the menubar instead. You should replace such usages with
calls to FrontNonFloatingWindow or (preferred) ActiveNonFloatingWindow.



On Tue, Sep 21, 2010 at 8:00 PM, Ponzu <lee.ponzu at gmail.com> wrote:

> I get 12 of these messages when I build the latest ...
>
> /Users/elee/Documents/hg/viewer-development/indra/llplugin/slplugin/slplugin.cpp:331:0
> /Users/elee/Documents/hg/viewer-development/indra/llplugin/slplugin/slplugin.cpp:331:
> warning: 'FrontWindow' is deprecated (declared at
> /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/MacWindows.h:11398)
>
> I don't think I am using the SLPlugin, so I am not concerned at the moment,
> but if someone knows the quick fix, please let me know.
>
>
> regards
>
> lee
>
> _______________________________________________
> Policies and (un)subscribe information available here:
> http://wiki.secondlife.com/wiki/OpenSource-Dev
> Please read the policies before posting to keep unmoderated posting
> privileges
>



-- 
-------------------------------------------------------------------------------------------------------------------------------
This email is a private and confidential communication. Any use of email may
be subject to the laws and regulations of the United States. You may not
Repost, Distribute nor reproduce any content of this message.
-------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.secondlife.com/pipermail/opensource-dev/attachments/20100921/d4050d44/attachment.htm 


More information about the opensource-dev mailing list