<AWT Dev> [8] Review request for 7149062: [macosx] dock menu don't show available frames

Anthony Petrov anthony.petrov at oracle.com
Fri May 4 04:43:17 PDT 2012

Hi Scott,

I'm sorry for the delay with my response. Thank you very much for the 

On 4/23/2012 9:15 PM, Scott Kovatch wrote:
> This looks fine to me. Only question is in CPlatformWindow:
>  313         if (Window.Type.UTILITY.equals(target.getType())) {
>  314             styleBits = SET(styleBits, UTILITY, true);
>  315         }
> Is this new? It looks needed but not necessarily part of this fix.

Indeed. I've filed a separate CR 7166437 to address this issue.

> It's unfortunate that you have to replicate code in AWTWindow_Normal and AWTWindow_Panel, but I don't see a better way to do it since you want to override methods. Would a category work here? There's not a lot of code here, but it may be harder to maintain over time.

I've investigated that, but it looks like a category (or an extension) 
requires a class name to add methods to. It's impossible to define an 
anonymous category and then apply it to two different classes. However, 
for the sake of this fix we do need to have two distinct classes: one 
inheriting from NSWindow, and another - from NSPanel. I can't find 
anything Obj-C-wise that could help eliminate the code replication here. 
Well, we could extract it into a separate file and #include it within 
the corresponding @implementation sections. But given the really small 
size of the replicated code this would look a bit weird in my opinion.

So I re-generated the webrev w/o the UTILITY thing mentioned above. The 
final webrev is at:


Looks OK to push that?

best regards,

> -- Scott
> On Apr 23, 2012, at 7:34 AM, Anthony Petrov wrote:
>> Mike et al.,
>> Could I get a review for this fix please?
>> --
>> best regards,
>> Anthony
>> On 04/18/12 16:37, Anthony Petrov wrote:
>>> Hello,
>>> Please review a fix for http://bugs.sun.com/view_bug.do?bug_id=7149062 at:
>>> http://cr.openjdk.java.net/~anthony/8-26-windowListInDockMenu-7149062.0/
>>> The AWTWindow class now inherits from NSObject and implements the
>>> NSWindowDelegate protocol. The real NSWindow object is held in the
>>> nsWindow property of the AWTWindow class, and is represented by either
>>> an AWTWindow_Normal or AWTWindow_Panel instance. These two classes
>>> inherit from NSWindow and NSPanel correspondingly. Note, however, that
>>> we still return a reference to the NSWindow/NSPanel instance to Java so
>>> that the pointer could be used with CWrapper methods directly. A
>>> reference to an associated AWTWindow instance is always available as
>>> (AWTWindow*)[nsWindow delegate].
>>> All windows that inherit from NSWindow are added to the windows list in
>>> the dock icon menu by default. We use NSPanel-based windows for UTILITY,
>>> HUD, NONACTIVATING, and HIDES_ON_DEACTIVATE windows only, because these
>>> kinds of windows typically don't represent main application windows, and
>>> thus aren't expected to be added to the windows list. Besides, UTILITY
>>> (and HUD?) windows just have to be NSPanels.
>>> This fix is going to be back-ported to 7u6 later on.
>>> --
>>> best regards,
>>> Anthony

More information about the awt-dev mailing list