<AWT Dev> Replacement for com.apple.eawt.FullScreen*
Sergey.Bylokhov at oracle.com
Mon Jul 22 21:58:06 UTC 2019
I guess this feature have to be implemented by this CR:
The idea was to use the sequence of: "setExtendedState() + MAXIMIZED_BOTH"
to toggle the "fullscreen" window. And use the client property to enable/disable
this functionality. But it looks like something has changed since then, and
the window does not move to the "fullscreen" when we zoom it.
Please file a bug for this.
Interesting that the "fullscreen" works fine if the user clicks on the zoom button.
On 20/07/2019 17:03, DRC wrote:
> I've been beating my head against the wall about this for quite a while,
> but I can't figure out how to programmatically toggle "Lion Full-Screen
> Mode" (i.e. "Full-Screen Mode Using Spaces") on macOS without using the
> deprecated com.apple.eawt.FullScreen* classes, which are problematic at
> best when including a custom JRE in my app using jlink. I looked at the
> OpenJDK 12 source, and it doesn't appear that the native code to do this
> toggling has any other touch points besides the
> com.apple.eawt.FullScreen* classes. What am I missing? The problem is
> that, because I'm writing a remote desktop client, I have to provide
> users with a way to switch in and out of full-screen mode with a
> keystroke and menu option, and I also have to be able to detect when the
> user clicks the full-screen button in the window's titlebar. I don't
> know how to do that without invoking
> com.apple.eawt.FullScreenListener.addFullScreenListenerTo() and
> com.apple.eawt.Application.requestToggleFullScreen(). Any advice is
Best regards, Sergey.
More information about the awt-dev