Skip to content

Commit 4b07d92

Browse files
committed
fix: keep window capture overlays fully transparent on start
1 parent 1d20c75 commit 4b07d92

2 files changed

Lines changed: 51 additions & 52 deletions

File tree

apps/desktop/src/App.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,14 @@ function createThemeListener(currentWindow: WebviewWindow) {
256256
}
257257

258258
function LoadingScreen() {
259+
if (
260+
location.pathname === "/target-select-overlay" ||
261+
location.pathname === "/window-capture-occluder" ||
262+
location.pathname === "/recordings-overlay"
263+
) {
264+
return <div class="h-screen w-screen bg-transparent" />;
265+
}
266+
259267
return (
260268
<div class="flex h-screen w-screen items-center justify-center bg-[#0d111a]/95 p-6">
261269
<div class="drift-panel flex min-w-[18rem] items-center gap-4 rounded-[28px] px-6 py-5">
Lines changed: 43 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getAllWindows } from "@tauri-apps/api/window";
2-
import { Show, Suspense } from "solid-js";
2+
import { Show } from "solid-js";
33
import { createCurrentRecordingQuery } from "~/utils/queries";
44

55
export default function () {
@@ -24,57 +24,48 @@ export default function () {
2424
};
2525

2626
return (
27-
<Suspense>
28-
<Show when={bounds()}>
29-
{(bounds) => {
30-
getAllWindows().then((w) =>
31-
w.forEach((w) => {
32-
if (w.label === "camera" || w.label === "in-progress-recording")
33-
w.setFocus();
34-
}),
35-
);
27+
<Show when={bounds()}>
28+
{(bounds) => {
29+
getAllWindows().then((w) =>
30+
w.forEach((w) => {
31+
if (w.label === "camera" || w.label === "in-progress-recording")
32+
w.setFocus();
33+
}),
34+
);
3635

37-
return (
38-
<div class="size-full absolute inset-0 *:absolute *:bg-black/50 *:pointer-events-none">
39-
{(() => {
40-
const { size, position } = bounds();
41-
return (
42-
<>
43-
{/* Top blind */}
44-
<div
45-
class="top-0 left-0 w-full"
46-
style={{ height: `${position.y}px` }}
47-
/>
48-
{/* Bottom blind */}
49-
<div
50-
class="left-0 bottom-0 w-full"
51-
style={{ top: `${position.y + size.height}px` }}
52-
/>
53-
{/* Left blind */}
54-
<div
55-
class="left-0"
56-
style={{
57-
top: `${position.y}px`,
58-
width: `${position.x}px`,
59-
height: `${size.height}px`,
60-
}}
61-
/>
62-
{/* Right blind */}
63-
<div
64-
class="right-0"
65-
style={{
66-
top: `${position.y}px`,
67-
left: `${position.x + size.width}px`,
68-
height: `${size.height}px`,
69-
}}
70-
/>
71-
</>
72-
);
73-
})()}
74-
</div>
75-
);
76-
}}
77-
</Show>
78-
</Suspense>
36+
return (
37+
<div class="size-full absolute inset-0 *:absolute *:bg-black/50 *:pointer-events-none">
38+
{(() => {
39+
const { size, position } = bounds();
40+
return (
41+
<>
42+
<div class="top-0 left-0 w-full" style={{ height: `${position.y}px` }} />
43+
<div
44+
class="left-0 bottom-0 w-full"
45+
style={{ top: `${position.y + size.height}px` }}
46+
/>
47+
<div
48+
class="left-0"
49+
style={{
50+
top: `${position.y}px`,
51+
width: `${position.x}px`,
52+
height: `${size.height}px`,
53+
}}
54+
/>
55+
<div
56+
class="right-0"
57+
style={{
58+
top: `${position.y}px`,
59+
left: `${position.x + size.width}px`,
60+
height: `${size.height}px`,
61+
}}
62+
/>
63+
</>
64+
);
65+
})()}
66+
</div>
67+
);
68+
}}
69+
</Show>
7970
);
8071
}

0 commit comments

Comments
 (0)