Re: From Panther to Tiger
Re: From Panther to Tiger
- Subject: Re: From Panther to Tiger
- From: Eric Schlegel <email@hidden>
- Date: Mon, 16 May 2005 13:55:30 -0700
On May 16, 2005, at 1:44 PM, John Stiles wrote:
Followers of Carbon-dev will note that Panther was the first OS
release to put the menubar in the window list. In Panther, though,
the OS actually made a special case for some window-list calls to
exclude the menubar from the list, because some third-party apps
made invalid assumptions about the topmost window. At that time, I
believe Apple did mention that these special cases were temporary
measures and that you should update your code to never make
assumptions about the first entry in the window list.
No, actually, Tiger is the first OS release to put the menubar in the
window list. Panther did not use a WindowRef for the menubar.
I replied privately to Rob, but since you mentioned it again on cocoa-
dev, I'll also note that due to numerous other apps making the same
assumption as Rob's app, in the final version of Tiger we modified
GetWindowList so that it would not return the menubar. We applied the
same compatibility change to GetFrontWindowOfClass
(kAllWindowClasses). You will, however, get the menubar window back
from these two APIs if you build your app as mach-o on Tiger. This
keeps existing apps (which were built on earlier releases of the OS)
working as they expected, while encouraging app developers to do the
right thing when they recompile for Tiger. The Cocoa team also
commonly uses this approach to introduce new, more correct behavior,
while avoiding breaking existing apps.
For that matter, the menubar isn't the only window that the OS
could create on top of all of your windows--the inline input
floater, if showing, would normally show up first in the window
list, above all application windows. This has been true since
Carbon in OS X 10.0.
Very true.
A Carbon app which makes assumptions about the window list—i.e. my
windows will be the only windows in the window list, or this
document window that I created frontmost will be the first item in
the window list—was always broken. The menubar window makes it very
clear about the breakage, as opposed to other cases that tended to
be rare, but just because code works most of the time, doesn't make
it correct.
Also true.
-eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden