diff --git a/hxd/Window.js.hx b/hxd/Window.js.hx index 388232b98..9448e195f 100644 --- a/hxd/Window.js.hx +++ b/hxd/Window.js.hx @@ -495,6 +495,7 @@ class Window { return Windowed; } + public static var FULLSCREEN_ORIENTATION:js.html.OrientationLockType = LANDSCAPE; function set_displayMode( m : DisplayMode ) : DisplayMode { if( !js.Browser.supported ) return m; @@ -503,10 +504,16 @@ class Window { var fullscreen = m != Windowed; if( (doc.fullscreenElement == elt) == fullscreen ) return Windowed; - if( m != Windowed ) - elt.requestFullscreen(); - else - doc.exitFullscreen(); + if( m != Windowed ) { + if (elt.requestFullscreen != null) { + elt.requestFullscreen({ navigationUI: "hide" }); + js.Browser.window.screen.orientation.lock(FULLSCREEN_ORIENTATION); + } + } else { + if (doc.exitFullscreen != null) { + doc.exitFullscreen(); + } + } return m; }