[8] Request for review: 8003173 [macosx] Fullscreen on Mac leaves an empty rectangle
Anthony Petrov
anthony.petrov at oracle.com
Wed Jan 9 06:40:48 PST 2013
Hi Sergey,
src/macosx/classes/sun/lwawt/LWWindowPeer.java:
Note that theoretically the insets can be changed w/o changing the
content size. For example, if a user switches to a theme with enlarged
window decorations. Not sure if this applies to Mac presently, but in
theory this is possible. Will sending the COMPONENT_RESIZE event be
equivalent to calling the replaceSurfaceData() in this case? Also, since
the event is only posted but not processed yet, what is the point to
call repaintPeer() before the surface data is replaced?
src/macosx/classes/sun/lwawt/macosx/CPlatformView.java:
The actual fix seems to reside in this file. Why doesn't
peer.getInsets() return zeros in the full screen mode? If it does
actually, why do we need this change then? A generic, insets-accounting
size calculation seems to be preferable in case we need a non-zero
insets for some specific use-cases in the future.
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java:
> 876 peer.updateInsets(getInsets());
This will call a native method upon sending every move/resize event. Why
do we actually have to do this? I assume the peer already calls the
PlatformWindow.getInsets() whenever needed. Also, AFAIK, insets rarely
change on Mac, and you already handle their manual changes when
entering/exiting the full screen mode. Can we just remove this line?
src/macosx/native/sun/awt/AWTWindow.m
> 821 [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
> 822 AWT_ASSERT_APPKIT_THREAD;
This ASSERT statement may safely be removed since the ThreadUtilities
already guarantee us that we're running on the main thread.
--
best regards,
Anthony
On 1/9/2013 17:32, Sergey Bylokhov wrote:
> Hello,
> Please review the fix.
> The reason why we have an empty space in the full screen mode is that we
> did not update our insets.
> - I update insets in the deliverMoveResizeEvent not in the
> windowDidEnterFullScreen, in this case animation became more
> smooth(since we update insets just before paint action). So all old
> fullscreen handle methods in CPlatformWindow were removed.
> - LWWindowPeer.updateInsets will post ComponentEvent if insets were
> changed.
> - CGraphicsDevice.setDisplayMode now stores/restores full screen
> window, because otherwise NSView looks shifted on screen.
> - CPlatformView.enterFullScreenMode(): code related to insets was
> removed, since NSVIew uses the whole screen unlike jdk 6.(see related
> changes in CPlatformWindow.enter/exitFullScreenMode)
>
>
> Bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8003173
> Webrev can be found at: http://cr.openjdk.java.net/~serb/8003173/webrev.00
>
More information about the macosx-port-dev
mailing list