Fullscreen issues on OS X

So there seem to be two separate fullscreen modes with OpenFL on OS X:

  1. Pressing the green button (on Yosemite) or the dedicated “fullscreen” button (on Lion, Mountain Lion, Mavericks), which utilises the whole screen and allows switching to other windows.
  2. Setting stage.displayState, which has various issues:
    a. While in this mode there is a constant black border at the top of the screen the size of the OS X menu bar.
    b. Trying to exit this mode (by setting stage.displayState = StageDisplayState.NORMAL) resizes the content to the size of the window, but remains fullscreen, leaving black borders around the content.
    c. There is no way to switch to another window without exiting fullscreen mode.

While it’s always been the case that the two separate fullscreen modes have existed, it’s only been the case that 2a and 2b have been issues since updating to the next codebase (but compiling without -Dnext).

My preference would be for setting stage.displayState to enter fullscreen mode 1 (the same as using the window manager’s button).

I should mention that I’m using recent builds from openfl.org/builds:


I’m not seeing the same.

I could try downloading one of those builds, and seeing if there’s a difference from the build server than what I build locally here on my system, but here is how it worked for me.

I tried the following to run PiratePig in fullscreen:

lime test neko --window-fullscreen=true

The screen faded through black to a fullscreen PiratePig, no bars. I then added the following code to the PiratePig.hx file:

addEventListener ("mouseDown", function (_) {
	if (stage.displayState != NORMAL) {
		stage.displayState = NORMAL;
	} else {
		stage.displayState = FULL_SCREEN;

When I switch, it fades and goes back to a standard window, then back to fullscreen. This is on OS X Yosemite.

Following those exact steps produces the same issues I’m seeing (also on OS X Yosemite).

I was also seeing the issue before with the following versions of libraries:


I’m using Haxe 3.1.3, downloaded from haxe.org. I’m on a Macbook Pro with an Intel HD Graphics 3000; maybe this could cause an issue?

Actually, fairly recently, I switched to a newer SDL2 build, perhaps that is related. Would you mind trying a current OpenFL and Lime build, and see if it acts differently?

It’s still occuring with the haxelib versions of OpenFL and Lime (is that what you meant by current?). I’ll try downloading some older versions and see if I can pinpoint when it started happening.

No, no, go to http://www.openfl.org/builds/lime and http://www.openfl.org/builds/openfl and try the latest there, these haven’t been released

Right, okay. No, it’s still functioning the same for me.

So I’ve been trying to test this with different builds.

Issues 2a and 2b don’t occur when using lime 1.0.1 and openfl 2.0.1. I’m having trouble trying to get any of the alpha versions of lime to run, but when using lime 2.0.0 and openfl 2.1.6, issues 2a and 2b do occur.

Looking into the SDL backend, from version 2.0.2, it seems like if we use SDL_WINDOW_FULLSCREEN_DESKTOP instead of SDL_WINDOW_FULLSCREEN, it should create a new space and behave as though you’d used the window manager button: https://forums.libsdl.org/viewtopic.php?p=42466&sid=04e7eb76a28229818b3c0de5f926434b

I’m not sure if games should behave with the same fullscreen switching behavior, also, I’m not sure of the performance implications of that desktop mode rather than standard mode switching (which may perform better at low resolutions)

The black bars may be dependent on not handling stage resizing. Also, when you disable fullscreen, it should switch back to your windowed size. For example, if you use your game will start fullscreen, but will go to 640 x 480 when you switch back out of fullscreen

For our part, we haven’t seen any performance issues with using the spaces-style fullscreen and the fact that the current mode-switching behaviour doesn’t allow you to ⌘+Tab away to other applications is unworkable.

Would there be an easy way to implement an optional flag to specify this behaviour? Or could you point me up the right path for hacking it in for myself? At this point, I’m considering disabling in-game fullscreen options and relying on the window manager button.