fix: electron title bar drag-region

Signed-off-by: Innei <i@innei.in>
This commit is contained in:
Innei 2024-09-03 17:17:58 +08:00
parent 7490cd12d0
commit 29ab32344f
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
1 changed files with 13 additions and 14 deletions

View File

@ -5,7 +5,6 @@ import { Outlet } from "react-router-dom"
import { env } from "../../env.js"
import { useAppIsReady } from "./atoms/app"
import { useUISettingKey } from "./atoms/settings/ui"
import { RootPortal } from "./components/ui/portal/index.js"
import { applyAfterReadyCallbacks } from "./initialize/queue.js"
import { appLog } from "./lib/log"
import { cn, getOS } from "./lib/utils"
@ -46,19 +45,19 @@ function App() {
const windowsElectron = window.electron && getOS() === "Windows"
return (
<RootProviders>
<RootPortal>
{window.electron && (
<div
className={cn(
"fixed inset-x-0 top-0 h-12 shrink-0",
windowsElectron && "pointer-events-none z-[9999]",
)}
aria-hidden
>
{windowsElectron && <Titlebar />}
</div>
)}
</RootPortal>
{window.electron && (
<div
className={cn(
"drag-region fixed inset-x-0 top-0 h-12 shrink-0",
windowsElectron && "pointer-events-none z-[9999]",
)}
aria-hidden
>
{windowsElectron && <Titlebar />}
</div>
)}
<AppLayer />
</RootProviders>
)