Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

Notes is working, and not showing in the screen recorder

itzadetunji9711a6c54e1f
diff --git a/electron/electron-env.d.ts b/electron/electron-env.d.ts
index a4972be61..72e73d792 100644
--- a/electron/electron-env.d.ts
+++ b/electron/electron-env.d.ts
@@ -41,6 +41,10 @@ interface Window {
error?: string;
};
}>;
+ openNotes: () => Promise<{
+ opened: boolean;
+ reason?: string;
+ }>;
selectSource: (source: ProcessedDesktopSource) => Promise<ProcessedDesktopSource | null>;
getSelectedSource: () => Promise<ProcessedDesktopSource | null>;
onSelectedSourceChanged: (callback: (source: ProcessedDesktopSource) => void) => () => void;
diff --git a/electron/ipc/handlers.ts b/electron/ipc/handlers.ts
index 85d154881..d8a1ee55a 100644
--- a/electron/ipc/handlers.ts
+++ b/electron/ipc/handlers.ts
@@ -1280,8 +1280,10 @@ export function registerIpcHandlers(
createEditorWindow: () => void,
createSourceSelectorWindow: () => BrowserWindow,
createCountdownOverlayWindow: () => BrowserWindow,
+ createNotesWindowWrapper: () => BrowserWindow,
getMainWindow: () => BrowserWindow | null,
getSourceSelectorWindow: () => BrowserWindow | null,
+ getNotesWindow: () => BrowserWindow | null,
getCountdownOverlayWindow?: () => BrowserWindow | null,
onRecordingStateChange?: (recording: boolean, sourceName: string) => void,
_switchToHud?: () => void,
@@ -1479,6 +1481,17 @@ export function registerIpcHandlers(
return { opened: true };
});
+ ipcMain.handle("open-notes", async () => {
+ const notesSelectorWin = getNotesWindow();
+ if (notesSelectorWin) {
+ notesSelectorWin.focus();
+ return { opened: true };
+ }
+
+ createNotesWindowWrapper();
+ return { opened: true };
+ });
+
ipcMain.handle("switch-to-editor", () => {
// createEditorWindow already closes the current mainWindow (the HUD) before
// opening the editor. Closing it here too double-closes, leaving ghost
diff --git a/electron/main.ts b/electron/main.ts
index a8e743fc9..6b533a8ff 100644
--- a/electron/main.ts
+++ b/electron/main.ts
@@ -25,6 +25,7 @@ import {
createCountdownOverlayWindow,
createEditorWindow,
createHudOverlayWindow,
+ createNotesWindow,
createSourceSelectorWindow,
} from "./windows";
@@ -84,6 +85,7 @@ process.env.VITE_PUBLIC = VITE_DEV_SERVER_URL
let mainWindow: BrowserWindow | null = null;
let sourceSelectorWindow: BrowserWindow | null = null;
let countdownOverlayWindow: BrowserWindow | null = null;
+let notesWindow: BrowserWindow | null = null;
let tray: Tray | null = null;
let selectedSourceName = "";
const isMac = process.platform === "darwin";
@@ -437,6 +439,19 @@ function createSourceSelectorWindowWrapper() {
return sourceSelectorWindow;
}
+function createNotesWindowWrapper() {
+ {
+ notesWindow = createNotesWindow();
+ notesWindow.on("closed", () => {
+ notesWindow = null;
+ if (mainWindow && !mainWindow.isDestroyed()) {
+ mainWindow.webContents.send("notes-window-closed");
+ }
+ });
+ return notesWindow;
+ }
+}
+
function createCountdownOverlayWindowWrapper() {
if (countdownOverlayWindow && !countdownOverlayWindow.isDestroyed()) {
return countdownOverlayWindow;
@@ -575,9 +590,11 @@ appReady?.then(async () => {
createEditorWindowWrapper,
createSourceSelectorWindowWrapper,
createCountdownOverlayWindowWrapper,
+ createNotesWindowWrapper,
() => mainWindow,
() => sourceSelectorWindow,
() => countdownOverlayWindow,
+ () => notesWindow,
(recording: boolean, sourceName: string) => {
selectedSourceName = sourceName;
if (!tray) createTray();
diff --git a/electron/preload.ts b/electron/preload.ts
index fefcac044..e0d246bda 100644
--- a/electron/preload.ts
+++ b/electron/preload.ts
@@ -47,6 +47,9 @@ contextBridge.exposeInMainWorld("electronAPI", {
openSourceSelector: () => {
return ipcRenderer.invoke("open-source-selector");
},
+ openNotes: () => {
+ return ipcRenderer.invoke("open-notes");
+ },
selectSource: (source: ProcessedDesktopSource) => {
return ipcRenderer.invoke("select-source", source);
},
diff --git a/electron/windows.ts b/electron/windows.ts
index c3830157f..7ccacc934 100644
--- a/electron/windows.ts
+++ b/electron/windows.ts
@@ -320,3 +320,43 @@ export function createCountdownOverlayWindow(): BrowserWindow {
return win;
}
+
+// Frameless Notes Window for taking notes during a recording.
+export function createNotesWindow(): BrowserWindow {
+ const win = new BrowserWindow({
+ width: 480,
+ height: 640,
+ frame: false,
+ transparent: true,
+ backgroundColor: "#00000000",
+ alwaysOnTop: true,
+ hasShadow: true,
+ vibrancy: "under-window",
+ visualEffectState: "active",
+ titleBarStyle: "hidden",
+ show: false,
+ webPreferences: {
+ preload: path.join(__dirname, "preload.mjs"),
+ additionalArguments: [ASSET_BASE_URL_ARG],
+ nodeIntegration: false,
+ contextIsolation: true,
+ backgroundThrottling: false,
+ },
+ });
+
+ win.setContentProtection(true);
+ win.once("ready-to-show", () => {
+ win.setContentProtection(true);
+ win.show();
+ });
+
+ if (VITE_DEV_SERVER_URL) {
+ win.loadURL(VITE_DEV_SERVER_URL + "?windowType=notes");
+ } else {
+ win.loadFile(path.join(RENDERER_DIST, "index.html"), {
+ query: { windowType: "notes" },
+ });
+ }
+
+ return win;
+}
diff --git a/package.json b/package.json
index 04ca1b839..52113c431 100644
--- a/package.json
+++ b/package.json
@@ -131,5 +131,9 @@
"main": "dist-electron/main.js",
"lint-staged": {
"*.{ts,tsx,js,jsx,mts,cts,json}": "biome check --no-errors-on-unmatched"
+ },
+ "allowScripts": {
}
}
diff --git a/src/App.tsx b/src/App.tsx
index 0c8875d04..0ba459e10 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,6 +1,7 @@
import { lazy, Suspense, useEffect, useState } from "react";
import { CountdownOverlay } from "./components/launch/CountdownOverlay.tsx";
import { LaunchWindow } from "./components/launch/LaunchWindow";
+import { NotesWindow } from "./components/launch/NotesWindow.tsx";
import { SourceSelector } from "./components/launch/SourceSelector";
import { Toaster } from "./components/ui/sonner";
import { TooltipProvider } from "./components/ui/tooltip";
@@ -57,6 +58,8 @@ export default function App() {
const content = (() => {
switch (windowType) {
+ case "notes":
+ return <NotesWindow />;
case "hud-overlay":
return <LaunchWindow />;
case "source-selector":
diff --git a/src/components/launch/LaunchWindow.tsx b/src/components/launch/LaunchWindow.tsx
index 2748a7fa6..86eac7d3f 100644
--- a/src/components/launch/LaunchWindow.tsx
+++ b/src/components/launch/LaunchWindow.tsx
@@ -1046,7 +1046,10 @@ export function LaunchWindow() {
)}
<Tooltip content={t("tooltips.openNotes")}>
- <button className={`${hudIconBtnClasses} ${styles.electronNoDrag}`}>
+ <button
+ className={`${hudIconBtnClasses} ${styles.electronNoDrag}`}
+ onClick={() => window.electronAPI.openNotes()}
+ >
<NotepadText size={ICON_SIZE} className="text-white/60" />
</button>
</Tooltip>
diff --git a/src/components/launch/NotesWindow.tsx b/src/components/launch/NotesWindow.tsx
new file mode 100644
index 000000000..d93709076
--- /dev/null
+++ b/src/components/launch/NotesWindow.tsx
@@ -0,0 +1,20 @@
+import React, { useState } from "react";
+
+export function NotesWindow() {
+ const [notes, setNotes] = useState("");
+
+ const handleNotesChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
+ setNotes(e.target.value);
+ };
+
+ return (
+ <div className="bg-red-900 h-100 w-100 ">
+ <textarea
+ className="w-full h-full bg-transparent outline-none resize-none"
+ placeholder="Take notes here..."
+ value={notes}
+ onChange={handleNotesChange}
+ />
+ </div>
+ );
+}