-
-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
window.fullscreen toggling error on MacOS #1771
Comments
Try adding event listeners to each of the following:
How many of them get dispatched, and at what point in the process? |
Okay, let's try that (for the record, here's the code with the inserted event handlers - https://gist.github.com/increpare/928e5ee0919d7da56d11ba2ab2c022b7 ) Pressing F three times: Source/Main.hx:66: keydown Pressing G twice Source/Main.hx:66: keydown |
Well, I think we found the culprit. When we receive a "maximize" window event, we set There aren't any other references to When testing on Linux, I can confirm that there's no |
Oho. Maybe it's related to hitting the maximize button on OSX having the same effect as going fullscreen? (At some point years ago macos changed the behaviour of the fullscreen button from a more Windows-style "expand window to fill screen" to actual full-screen). |
I've solved this issue by adding "onMaximized()" to native stage. Additionally, you should compare the value of the width or height of the stage with the screen resolution to check your app is already in full screen mode or not. It might be a little trick, "fullscreen" value of SDL library always returns "false" on macOS. The library seems to be outdated. You can also try the developing version of Lime/OpenFL for better results. |
Code snippet reproducing the issue:
The SimpleImage example with this main.hx file
Observed behavior:
Run the app in cpp/neko builds.
The app starts in windowed mode.
1: Press F to toggle fullscreen. The app is now in fullscreen.
2: Press F again. The app remains in fullscreen.
3: Press F again. The app is no longer in fullscreen.
Expected behavior:
I expect step 2 to bring me back to windowed mode.
Note the log output:
Note that it seems that FlxG.fullscreen is somehow getting turned back to false sometime between when it's toggled on and I've entered the new frame.
Also note that pressing G, which locally caches the 'fullscreen' value, doesn't have this behaviour.
The text was updated successfully, but these errors were encountered: