Desktop: Hide menu bar in fullscreen mode on Mac (#3464)

hide menu bar in fullscreen mode on mac
This commit is contained in:
Timon
2025-12-12 13:09:31 +00:00
committed by GitHub
parent 6d852f11af
commit 7532bd7260
8 changed files with 94 additions and 36 deletions
+8 -1
View File
@@ -1,12 +1,13 @@
import { writable } from "svelte/store";
import { type Editor } from "@graphite/editor";
import { type AppWindowPlatform, UpdatePlatform, UpdateViewportHolePunch, UpdateMaximized as UpdateMaximized } from "@graphite/messages";
import { type AppWindowPlatform, UpdatePlatform, UpdateViewportHolePunch, UpdateMaximized, UpdateFullscreen } from "@graphite/messages";
export function createAppWindowState(editor: Editor) {
const { subscribe, update } = writable({
platform: "Web" as AppWindowPlatform,
maximized: false,
fullscreen: false,
viewportHolePunch: false,
});
@@ -23,6 +24,12 @@ export function createAppWindowState(editor: Editor) {
return state;
});
});
editor.subscriptions.subscribeJsMessage(UpdateFullscreen, (updateFullscreen) => {
update((state) => {
state.fullscreen = updateFullscreen.fullscreen;
return state;
});
});
editor.subscriptions.subscribeJsMessage(UpdateViewportHolePunch, (viewportHolePunch) => {
update((state) => {
state.viewportHolePunch = viewportHolePunch.active;