<AWT Dev> [7u4] Review request for 7145818: [macosx] dialogs not showing when JFrame is in full screen mode
Mike Swingler
swingler at apple.com
Thu Mar 1 09:31:07 PST 2012
On Feb 29, 2012, at 6:58 AM, Anthony Petrov wrote:
> Hello,
>
> Please review a fix for http://bugs.sun.com/view_bug.do?bug_id=7145818 at:
>
> http://cr.openjdk.java.net/~anthony/x-21-popupInFullscreen-7145818.0/
>
> Thanks Mike for the suggestion to use the [NSWindow toggleFullScreen] API. I've tested the fix on both 10.7 and 10.6.8, and it works consistently on both systems. Although the new API is claimed to be supported starting with 10.7 only, it works fine on my 10.6.8 box as well (but prints out a warning about sending an unrecognized selector to an AWTWindow instance.)
>
> I've also verified that the native resize events contain correct window size, so I removed the machinery that sent synthetic events in the full screen mode.
A few points to consider:
* To protect against the unrecognized selector problem, you should test if the AWTWindow object -respondsToSelector:@selector(toggleFullScreen) before just calling it.
* Also, there is already API that calls -toggleFullScreen in the eAWT classes that you might not be aware of. You should probably test for interactions with that, since apps can opt their window into having a full screen widget icon and independently toggle fullscreen.
* In some cases, seeing the menubar is actually desirable, where as in the "exclusive" mode, it's probably not. Perhaps you could consult a client property on the window to determine if the menu bar should be hidden?
I like this overall solution, because it uses the native platform concept of full screen which doesn't trap the user from switching spaces like the Java SE 6 implementation did.
Regards,
Mike Swingler
Apple Inc.
More information about the awt-dev
mailing list