From 4e1464ef17296300c086828b44422d16d6dc15cc Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Sun, 12 Apr 2026 16:05:27 +0800 Subject: [PATCH] fix(macOS): don't show window button when traffic lights are on the header, closes #3831 (#3843) --- apps/readest-app/src/app/library/page.tsx | 2 +- apps/readest-app/src/app/reader/components/HeaderBar.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/readest-app/src/app/library/page.tsx b/apps/readest-app/src/app/library/page.tsx index a2292fa2..5112582f 100644 --- a/apps/readest-app/src/app/library/page.tsx +++ b/apps/readest-app/src/app/library/page.tsx @@ -476,7 +476,7 @@ const LibraryPageContent = ({ searchParams }: { searchParams: ReadonlyURLSearchP isInitiating.current = false; }; // eslint-disable-next-line react-hooks/exhaustive-deps - }, [searchParams]); + }, []); useEffect(() => { const group = searchParams?.get('group') || ''; diff --git a/apps/readest-app/src/app/reader/components/HeaderBar.tsx b/apps/readest-app/src/app/reader/components/HeaderBar.tsx index cf2d12d5..f0046c19 100644 --- a/apps/readest-app/src/app/reader/components/HeaderBar.tsx +++ b/apps/readest-app/src/app/reader/components/HeaderBar.tsx @@ -69,7 +69,6 @@ const HeaderBar: React.FC = ({ const iconSize16 = useResponsiveSize(16); const iconSize18 = useResponsiveSize(18); const headerRef = useRef(null); - const windowButtonVisible = appService?.hasWindowBar && !isTrafficLightVisible; const docs = view?.renderer.getContents() ?? []; const pointerInDoc = docs.some(({ doc }) => doc?.body?.style.cursor === 'pointer'); @@ -138,6 +137,8 @@ const HeaderBar: React.FC = ({ useSpatialNavigation(headerRef, isHeaderVisible); const trafficLightInHeader = appService?.hasTrafficLight && !trafficLightInFullscreen && !isSideBarVisible && isTopLeft; + const windowButtonVisible = + appService?.hasWindowBar && !isTrafficLightVisible && !trafficLightInHeader; return (