Hi, Alexander.
As far as I understand the main issue is that we get a native
notifications during window initialization(after nswindows was created
and before zoom method will be called)? Probably we can apply the zoom
state when we create a window in one appkit call?
On 08.04.15 17:54, Alexander Scherbatiy wrote:
Hello,
Could you review the fix:
bug: https://bugs.openjdk.java.net/browse/JDK-8065739
webrev: http://cr.openjdk.java.net/~alexsch/8065739/webrev.00
Use case:
------------
Frame frame = new Frame();
frame.pack();
frame.setBounds(screenBounds);
frame.setVisible(true);
------------
The frame is in the normal state but Mac OS X treats a frame with
screen bounds as zoomed.
The setVisible() method calls unmaximize() method to return the
zoomed window to the normal state.
The native zoom() method sets the initial sizes for the window which
are zero because of the pack() call.
There is already checkZoom() method which synchronizes native window
zoom state and and the frame extended state when a frame is resized by
mouse.
However it can't be always used for the synchronization between
native window zoom state and setBounds() call because of the following
case:
-----------------
Frame frame = new Frame();
frame.setBounds(smallBounds);
frame.setExtendedState(Frame.MAXIMIZED_BOTH);
frame.setVisible(true);
-----------------
This is the valid scenario where the frame should be maximized.
The solution synchronizes the zoom and the frame state only when the
native window is zoomed.
In opposite case we need to return from the zoomed sizes to previous
sizes which are the same as for the zoomed window.
Thanks,
Alexandr.
--
Best regards, Sergey.