diff --git a/app/ui.js b/app/ui.js index ee831961..714c0dec 100644 --- a/app/ui.js +++ b/app/ui.js @@ -1251,6 +1251,7 @@ const UI = { document.getElementById('noVNC_fullscreen_button') .classList.remove("noVNC_selected"); } + UI.updatePointerLockButton(); }, /* ------^------- @@ -1308,8 +1309,13 @@ const UI = { updatePointerLockButton() { // Only show the button if the pointer lock API is properly supported + // AND in fullscreen. if ( UI.connected && + (document.fullscreenElement || // alternative standard method + document.mozFullScreenElement || // currently working methods + document.webkitFullscreenElement || + document.msFullscreenElement) && (document.pointerLockElement !== undefined || document.mozPointerLockElement !== undefined) ) {