<AWT Dev> Replacement for com.apple.eawt.FullScreen*

DRC drc at virtualgl.org
Sun Jul 21 00:03:02 UTC 2019


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
appreciated.

DRC


More information about the awt-dev mailing list