[FIXED] Use Mac OS X [native] Fullscreen APIs

Started by Kroc, July 11, 2012, 17:53:35

Previous topic - Next topic

Kroc

Wow, that’s the most hostile registration process I’ve ever seen... Anyway;

I’m not a coder (not of Java anyway) but here’s something important LWJGL is going to need going forward.

When going fullscreen, please utilise the native Mac OS X fullscreen APIs (OS X Lion and above). This way, the fullscreen application goes into its own workspace, and the user can easily switch between open windows whilst in fullscreen.

At the moment it is a pain to have to bring Minecraft out of fullscreen, in order to refer to something in my web browser, when OS X handles this fine with other apps.

Worse than minor nuisance is that if Minecraft locks up whilst in fullscreen, there is absolutely no way to exit the app. I have to forcibly cut the power! That’s not going to cut the mustard!

Hoping you consider this,
Kind regards

Kroc Camen.

Matzon

Quote from: Kroc on July 11, 2012, 17:53:35
Wow, that’s the most hostile registration process I’ve ever seen... Anyway;
Thank you, we try our best to root out the weed ;)

Quote from: Kroc on July 11, 2012, 17:53:35
When going fullscreen, please utilise the native Mac OS X fullscreen APIs (OS X Lion and above). This way, the fullscreen application goes into its own workspace, and the user can easily switch between open windows whilst in fullscreen.
We need to change a fair bit on osx for java 7 - chief among this is a full cocoa backend, which should solve these issues.
No ETA for this work though.

Kroc

Thanks, just glad to have it acknowledged. :)

I look forward to the day I’ll be able to play Minecraft and refer to my browser without so much fuss.

kappa

Added some initial code in the nightly builds to implement the native OS X 10.7+ fullscreen mode API. This allows the game to get its own workspace.

You can switch to/from fullscreen mode via the OS X gui button in the window title, once the LWJGL fullscreen mode api switch is enabled.



Toggling to/from native fullscreen via Display.setFullscreen() and Display.isFullscreen() isn't implemented yet (not sure whether to go down that route yet as the normal fullscreen uses the DisplayMode and this just uses the current desktop resolution).

The fullscreen mode API can be enabled using the org.lwjgl.opengl.Display.enableOSXFullscreenModeAPI switch:

e.g. as a VM parameter using:
-Dorg.lwjgl.opengl.Display.enableOSXFullscreenModeAPI=true

or in java code before creating the Display:
System.setProperty("org.lwjgl.opengl.Display.enableOSXFullscreenModeAPI", "true");


Anyone up for testing this feature you can do so using the latest LWJGL nightly builds.

kappa

Finalised the behaviour on the OS X fullscreen mode API.

The OS X fullscreen mode API is essentially just a way to resize/maximise an existing window to one without borders and not a true fullscreen mode in the LWJGL sense (which destroys any existing window, switches the DisplayMode/resolution of the monitor/screen before creating a new window).

Therefore the OS X fullscreen mode GUI button is now enabled by default (where available) when Display.setResizable(true) is set. When Display.setResizable(false) is set then the fullscreen mode GUI button will be unavailable.

So any existing games that already have a resizable Display window will just work like other native fullscreen OS X apps.

In any event the fullscreen mode api gui button can be disabled if required using the org.lwjgl.opengl.Display.disableOSXFullscreenModeAPI switch.