Skip to content
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

Phaser not correctly restoring state after using 'ESC' to exit fullscreen. #4357

Closed
khutchins opened this issue Feb 11, 2019 · 4 comments
Closed

Comments

@khutchins
Copy link

Version

  • Phaser Version: 3.16.2
  • Operating system: Windows 10
  • Browser: Chrome 72.0.3626.96, Firebox 65.0 (doesn't seem browser-specific)

Description

When exiting fullscreen mode using 'ESC', I expect that the Phaser game window will be restored to its previous size. Instead, it appears to be keeping its fullscreen size but in windowed mode.

Example Test Code

https://codepen.io/anon/pen/XOqMVP

To reproduce:

  1. Launch code pen.
  2. Click on Phaser window to gain focus.
  3. Press 'F' to trigger Phaser to toggle fullscreen.
  4. Exit fullscreen using ESC (not the natural Phaser path)
  5. Phaser window will not be the same size as it was before entering fullscreen.

Additional Information

@photonstorm
Copy link
Collaborator

Ahhh nuts, yes, you're right.

@codypotter
Copy link

Perhaps this could be fixed by changing the canvas to default size when the exit full screen event is captured.
document.addEventListener('fullscreenchange', exitHandler); document.addEventListener('webkitfullscreenchange', exitHandler); document.addEventListener('mozfullscreenchange', exitHandler); document.addEventListener('MSFullscreenChange', exitHandler);

@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

@khutchins
Copy link
Author

I'm no longer running into the issue with the version I built from head. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants