<AWT Dev> [7u4] Review request for 7124428: [macosx] Frame.setExtendedState() doesn't work for undecorated windows

Anthony Petrov anthony.petrov at oracle.com
Mon Mar 19 08:23:10 PDT 2012


Hi Mike,

On 03/17/12 00:08, Mike Swingler wrote:
>> Please review a fix for http://bugs.sun.com/view_bug.do?bug_id=7124428 at:
>>
>> http://cr.openjdk.java.net/~anthony/7u4-7-setExtendedStateUndecorated-7124428.0/
>>
>> It looks like OS X handles the -zoom request incorrectly for undecorated windows. Therefore we have to emulate it in our code.
>
> I'd suggest pulling the logic for choosing undecorated into the constructor, making the private boolean undecorated final, and then just relying on the value inside of getInitialStyleBits(). Making the undecorated boolean final serves as a warning to others in the future.

Non-final fields that are meant to be final are evil, I agree. However, 
in this particular case we can't initialize this field in the 
constructor because the target for this CPlatformWindow instance is 
unknown yet. We only get a reference to a Window object when the 
CPlatformWindow.initialize() is called which is happening after the 
constructor finishes execution. Thus the field has to be non-final.


> Otherwise, this looks great.

Thanks for the review.

--
best regards,
Anthony



More information about the awt-dev mailing list