From 707dcdbbb453e6198cd7d1071e789b579ebed235 Mon Sep 17 00:00:00 2001 From: yuanyuanxiang <962914132@qq.com> Date: Tue, 19 May 2026 22:20:55 +0200 Subject: [PATCH] Fix(Web): exit remote-desktop fullscreen blocks device-list clicks --- server/web/index.html | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/server/web/index.html b/server/web/index.html index fa947c7..59af9ff 100644 --- a/server/web/index.html +++ b/server/web/index.html @@ -1873,6 +1873,24 @@ } function showPage(pageId) { + // Leaving the remote-desktop page? Drop fullscreen first. + // #screen-page is the requestFullscreen target; while it remains + // the document.fullscreenElement the browser blocks pointer / + // keyboard interaction with anything outside its subtree — + // devices-page lives outside it, so without this exit a click + // ANYWHERE on the device list silently no-ops until the user + // hits ESC themselves. Same hazard for device_offline auto- + // navigation, manual Back, and any future navigation we add. + if (pageId !== 'screen-page') { + const sp = document.getElementById('screen-page'); + if (sp && sp.classList.contains('active')) { + if (document.fullscreenElement || document.webkitFullscreenElement) { + const exit = document.exitFullscreen || document.webkitExitFullscreen; + if (exit) exit.call(document).catch(() => {}); + } + sp.classList.remove('pseudo-fullscreen'); // iOS fallback path + } + } document.querySelectorAll('.page').forEach(p => p.classList.remove('active')); document.getElementById(pageId).classList.add('active'); }