From 225ee790d2ad4dfe9cc637d320db9465011ef7a4 Mon Sep 17 00:00:00 2001 From: luckfox-eng29 Date: Wed, 6 May 2026 18:59:10 +0800 Subject: [PATCH] fix(ui): keep fps only and ensure overlays fully cover video Signed-off-by: luckfox-eng29 --- ui/src/components/VideoOverlay.tsx | 12 ++++++------ ui/src/layout/core/bar_bottom/BottomBarMobile.tsx | 11 ++--------- ui/src/layout/core/bar_bottom/BottomBarPC.tsx | 12 +++--------- ui/src/layout/index.pc.tsx | 4 ++-- 4 files changed, 13 insertions(+), 26 deletions(-) diff --git a/ui/src/components/VideoOverlay.tsx b/ui/src/components/VideoOverlay.tsx index 70200cc..4b5e011 100644 --- a/ui/src/components/VideoOverlay.tsx +++ b/ui/src/components/VideoOverlay.tsx @@ -84,7 +84,7 @@ export function LoadingConnectionOverlay({ show, text }: LoadingConnectionOverla {show && ( {show && ( {show && ( {show && isNoSignal && ( {show && isOtherError && ( {show && ( state.keyboardLedState); - const videoSize = useVideoStore( - state => `${Math.round(state.clientWidth)}x${Math.round(state.clientHeight)}`, - ); const { isDark } = useTheme(); const setDisableFocusTrap = useUiStore(state => state.setDisableVideoFocusTrap); const toggleSidebarView = useUiStore(state => state.toggleSidebarView); @@ -79,10 +75,7 @@ export default function BottomBarMobile() { stats?.forEach(report => { if (report.type === "inbound-rtp") { - if(report.framesPerSecond){ - setFps(report.framesPerSecond) - } - + setFps(report.framesPerSecond ?? 0); } }); })(); @@ -117,7 +110,7 @@ export default function BottomBarMobile() { { icon: isDark ? Video2SVG : VideoSVG, label: $at("video") }, { icon: StateSvg, label: $at("status") }, ]; - const videoButtonLabel = forceHttp ? `${videoSize}` : `${videoSize} ${fps}fps `; + const videoButtonLabel = forceHttp ? "N/A fps" : `${Math.round(fps)}fps`; if(isVirtualKeyboardEnabled){ return <> } diff --git a/ui/src/layout/core/bar_bottom/BottomBarPC.tsx b/ui/src/layout/core/bar_bottom/BottomBarPC.tsx index c2b0db6..ee0c289 100644 --- a/ui/src/layout/core/bar_bottom/BottomBarPC.tsx +++ b/ui/src/layout/core/bar_bottom/BottomBarPC.tsx @@ -44,12 +44,6 @@ export default function BottomBarPC() { const activeModifiers = useHidStore(state => state.activeModifiers); const audioMode = useAudioModeStore(state => state.audioMode); const usbEpMode = useUsbEpModeStore(state => state.usbEpMode); - // const videoSize = useVideoStore( - // state => `${Math.round(state.width)}x${Math.round(state.height)}`, - // ); - const videoSize = useVideoStore( - state => `${Math.round(state.clientWidth)}x${Math.round(state.clientHeight)}`, - ); const setDisableFocusTrap = useUiStore(state => state.setDisableVideoFocusTrap); const toggleSidebarView = useUiStore(state => state.toggleSidebarView); const showPressedKeys = useSettingsStore(state => state.showPressedKeys); @@ -89,10 +83,10 @@ export default function BottomBarPC() { const videoButtonLabel = useMemo(() => { if (forceHttp) { - return `${videoSize}`; + return "N/A fps"; } - return `${videoSize} ${fps}fps `; - }, [forceHttp, videoSize, fps]); + return `${Math.round(fps)}fps`; + }, [forceHttp, fps]); useEffect(() => { send("getNetworkSettings", {}, resp => { if ("error" in resp) return; diff --git a/ui/src/layout/index.pc.tsx b/ui/src/layout/index.pc.tsx index 1849846..32b6a13 100644 --- a/ui/src/layout/index.pc.tsx +++ b/ui/src/layout/index.pc.tsx @@ -848,9 +848,9 @@ export default function PCHome() {
-
+
{!!ConnectionStatusElement && ConnectionStatusElement} {/**/}