<AWT Dev> [9] review request for 8066436: Minimize can cause window to disappear on osx

Nakul Natu nakul.natu at oracle.com
Thu Mar 5 22:26:54 UTC 2015


Hi Sergey and all,

Updated webrev with suggested changes and testcase.

http://cr.openjdk.java.net/~van/8066436/webrev.01/

Regards,
Nakul

On 3/4/15, 5:17 AM, Sergey Bylokhov wrote:
> Hi, Nakul.
> Thanks for the fix.
> A few notes:
>  - Please remove the bugid information from the comment since we have 
> mercurial history for such notes.
>  - I suppose that the comment can be shorter, like this: "We need an 
> up to date size of the peer, so we flush the native events to be sure 
> that there are no setBounds requests in the queue."
>  - Can you provide a test case for this bug, even if you cannot 
> reproduce it on your local system, you can write a test, which will 
> fail on the users system.
>
> On 02.03.2015 22:18, Nakul Natu wrote:
>> Hello,
>>
>> Please review the fix for JDK 9.
>>
>> CPlatformWindow set bounds using setBounds() which calls native 
>> function nativeNSSetWindowBounds() -> calls the OSX function. After 
>> that ox callbacks to java using deliverMoveresizeEvent() where the 
>> peer or window associated with native window is notified of change of 
>> bounds.
>>
>> In maximize() we need peer’s bound which are saved as normalBounds to 
>> use them to unmaximize.
>>
>> The problem
>> 1. Customer creates window where the size width height is (1, 1)
>> 2. setSize call is made (600,900) which starts the setBounds process 
>> described earlier
>> 3. setExtendedState(MAXIMIZED) is called which calls maximize(). But 
>> the callback for deliverMoveresizeEvent() has not yet processed and 
>> the the bounds we get are earlier (1,1).
>> 4. Window is maximized.
>> 5. Now when we try to unmaximize or iconify the window the size is 
>> set to (1,1) and we can’t see the window.
>>
>> Even if we are using the bounds which are available (as the event 
>> processing is asynchronous) this can cause lot of problems as the 
>> window just disappears. Adding LWCToolkit.flushNativeSelectors(); 
>> just before saving the bounds can get us the correct bounds which we 
>> are expecting.
>>
>> Bug : https://bugs.openjdk.java.net/browse/JDK-8066436
>> Webrev: http://cr.openjdk.java.net/~van/8066436/webrev.00/
>>
>> Regards,
>> Nakul
>>
>
>
> -- 
> Best regards, Sergey.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20150305/67a73a1c/attachment.html>


More information about the awt-dev mailing list