fix: should use fullscreen to control where to place macos window controls (#6351)

This commit is contained in:
pengx17
2024-03-28 03:40:46 +00:00
parent 4e7652f108
commit e53744b740
7 changed files with 53 additions and 16 deletions

View File

@@ -60,8 +60,13 @@ export function setup() {
const handleMaximized = (maximized: boolean | undefined) => {
document.documentElement.dataset.maximized = String(maximized);
};
const handleFullscreen = (fullscreen: boolean | undefined) => {
document.documentElement.dataset.fullscreen = String(fullscreen);
};
apis?.ui.isMaximized().then(handleMaximized).catch(console.error);
apis?.ui.isFullScreen().then(handleFullscreen).catch(console.error);
events?.ui.onMaximized(handleMaximized);
events?.ui.onFullScreen(handleFullscreen);
const handleResize = debounce(() => {
apis?.ui.handleWindowResize().catch(console.error);