macOS: window controls stop working when zoomed in (fix #242890) (#243120)

This commit is contained in:
Benjamin Pasero
2025-03-11 11:11:05 +01:00
committed by GitHub
parent 6f87a279c8
commit 9037210ea4
@@ -192,21 +192,23 @@ export function defaultBrowserWindowOptions(accessor: ServicesAccessor, windowSt
}
if (useWindowControlsOverlay(configurationService)) {
if (isMacintosh) {
options.titleBarOverlay = true;
} else {
// This logic will not perfectly guess the right colors
// to use on initialization, but prefer to keep things
// simple as it is temporary and not noticeable
// On macOS, only the presence of `titleBarOverlay` is
// considered, the properties are ignored.
// This logic will not perfectly guess the right colors
// to use on initialization, but prefer to keep things
// simple as it is temporary and not noticeable
const titleBarColor = themeMainService.getWindowSplash(undefined)?.colorInfo.titleBarBackground ?? themeMainService.getBackgroundColor();
const symbolColor = Color.fromHex(titleBarColor).isDarker() ? '#FFFFFF' : '#000000';
const titleBarColor = themeMainService.getWindowSplash(undefined)?.colorInfo.titleBarBackground ?? themeMainService.getBackgroundColor();
const symbolColor = Color.fromHex(titleBarColor).isDarker() ? '#FFFFFF' : '#000000';
options.titleBarOverlay = {
height: 29, // the smallest size of the title bar on windows accounting for the border on windows 11
color: titleBarColor,
symbolColor
};
options.titleBarOverlay = {
height: 29, // the smallest size of the title bar on windows accounting for the border on windows 11
color: titleBarColor,
symbolColor
};
}
}
}