fix(macOS): don't show window button when traffic lights are on the header, closes #3831 (#3843)

This commit is contained in:
Huang Xin 2026-04-12 16:05:27 +08:00 committed by GitHub
parent 7b60b1bb0c
commit 4e1464ef17
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -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') || '';

View file

@ -69,7 +69,6 @@ const HeaderBar: React.FC<HeaderBarProps> = ({
const iconSize16 = useResponsiveSize(16);
const iconSize18 = useResponsiveSize(18);
const headerRef = useRef<HTMLDivElement>(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<HeaderBarProps> = ({
useSpatialNavigation(headerRef, isHeaderVisible);
const trafficLightInHeader =
appService?.hasTrafficLight && !trafficLightInFullscreen && !isSideBarVisible && isTopLeft;
const windowButtonVisible =
appService?.hasWindowBar && !isTrafficLightVisible && !trafficLightInHeader;
return (
<div