Skip to content

Commit

Permalink
fix: electron title bar drag-region
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Sep 3, 2024
1 parent 7490cd1 commit 29ab323
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/renderer/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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>
)
Expand Down

0 comments on commit 29ab323

Please sign in to comment.