From 62b81e5145844b3c638ada2d0e0766cf4beeb782 Mon Sep 17 00:00:00 2001 From: /home/neo <158327205+neoapps-dev@users.noreply.github.com> Date: Sun, 28 Jun 2026 15:26:55 +0300 Subject: [PATCH] feat: bring back titlebar on non-macOS systems, and show on fullscreen (#96) --- src-tauri/capabilities/default.json | 5 +++++ src-tauri/gen/schemas/capabilities.json | 2 +- src/pages/App.tsx | 29 ++++++++++++++++++++++--- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 73fe8cb..b6831f1 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -15,6 +15,11 @@ "core:tray:default", "core:webview:default", "core:window:default", + "core:window:allow-set-decorations", + "core:window:allow-is-fullscreen", + "core:window:allow-minimize", + "core:window:allow-toggle-maximize", + "core:window:allow-close", "opener:default", "gamepad:default", "drpc:default", diff --git a/src-tauri/gen/schemas/capabilities.json b/src-tauri/gen/schemas/capabilities.json index 60e9995..69c30bb 100644 --- a/src-tauri/gen/schemas/capabilities.json +++ b/src-tauri/gen/schemas/capabilities.json @@ -1 +1 @@ -{"default":{"identifier":"default","description":"Default permissions","local":true,"windows":["main"],"permissions":["core:default","core:app:default","core:event:default","core:image:default","core:menu:default","core:path:default","core:resources:default","core:tray:default","core:webview:default","core:window:default","opener:default","gamepad:default","drpc:default","updater:default",{"identifier":"opener:allow-open-path","allow":[{"path":"**"}]},{"identifier":"opener:allow-reveal-item-in-dir","allow":[{"path":"**"}]},"process:default","deep-link:default"]},"desktop-capability":{"identifier":"desktop-capability","description":"","local":true,"windows":["main"],"permissions":["updater:default","process:default","deep-link:default"],"platforms":["macOS","windows","linux"]}} \ No newline at end of file +{"default":{"identifier":"default","description":"Default permissions","local":true,"windows":["main"],"permissions":["core:default","core:app:default","core:event:default","core:image:default","core:menu:default","core:path:default","core:resources:default","core:tray:default","core:webview:default","core:window:default","core:window:allow-set-decorations","core:window:allow-is-fullscreen","core:window:allow-minimize","core:window:allow-toggle-maximize","core:window:allow-close","opener:default","gamepad:default","drpc:default","updater:default",{"identifier":"opener:allow-open-path","allow":[{"path":"**"}]},{"identifier":"opener:allow-reveal-item-in-dir","allow":[{"path":"**"}]},"process:default","deep-link:default"]},"desktop-capability":{"identifier":"desktop-capability","description":"","local":true,"windows":["main"],"permissions":["updater:default","process:default","deep-link:default"],"platforms":["macOS","windows","linux"]}} \ No newline at end of file diff --git a/src/pages/App.tsx b/src/pages/App.tsx index c9f4c08..32c597c 100644 --- a/src/pages/App.tsx +++ b/src/pages/App.tsx @@ -23,6 +23,7 @@ import PanoramaBackground from "../components/common/PanoramaBackground"; import { ClickParticles } from "../components/common/ClickParticles"; import { CinematicIntro } from "../components/common/CinematicIntro"; import { DownloadOverlay } from "../components/layout/DownloadOverlay"; +import { AppHeader } from "../components/layout/AppHeader"; import { AchievementToast } from "../components/common/AchievementToast"; import { useUI, @@ -34,12 +35,14 @@ import { import { TauriService } from "../services/TauriService"; import { useLceLiveNotifications } from "../hooks/useLceLiveNotifications"; import { usePluginViews } from "../plugins/PluginContext"; +import { usePlatform } from "../hooks/usePlatform"; import { PluginManager } from "../plugins/PluginManager"; import { PluginViewContainer } from "../components/plugins/PluginViewContainer"; import type { Edition } from "../types/edition"; import type { ToastOptions } from "../plugins/types"; import pkg from "../../package.json"; import { getCurrent, onOpenUrl } from "@tauri-apps/plugin-deep-link"; +import { getCurrentWindow } from "@tauri-apps/api/window"; import { listen } from "@tauri-apps/api/event"; export default function App() { const ui = useUI(); @@ -152,7 +155,11 @@ export default function App() { return; } - if (action === "lcelive" && parts.length >= 2 && parts[1] === "addfriend") { + if ( + action === "lcelive" && + parts.length >= 2 && + parts[1] === "addfriend" + ) { const username = parsed.searchParams.get("username"); if (username) { setActiveView("lcelive"); @@ -243,6 +250,19 @@ export default function App() { if (unlistenEvent) unlistenEvent(); }; }, [queueDeepLink]); + const { isMac } = usePlatform(); + const [isFullscreen, setIsFullscreen] = useState(false); + useEffect(() => { + const appWindow = getCurrentWindow(); + if (!isMac) appWindow.setDecorations(false); + const checkFs = async () => setIsFullscreen(await appWindow.isFullscreen()); + checkFs(); + const unlisten = appWindow.onResized(checkFs); + return () => { + unlisten.then((fn: () => void) => fn()); + }; + }, [isMac]); + const showHeader = !isMac || isFullscreen; useEffect(() => { if (config.isLoaded) { const setupCompleted = @@ -341,6 +361,9 @@ export default function App() { {config.vfxEnabled && } + {showHeader && ( + + )} {!config.legacyMode && ( - +