diff --git a/src/hooks/useScreenRecorder.test.ts b/src/hooks/useScreenRecorder.test.ts index 7b48fcd12..593016e85 100644 --- a/src/hooks/useScreenRecorder.test.ts +++ b/src/hooks/useScreenRecorder.test.ts @@ -158,6 +158,27 @@ describe("resolveBrowserCaptureCursorPolicy", () => { hideEditorOverlayCursorByDefault: true, }); }); + + it("enables the editor overlay by default on Linux, where the OS cursor cannot be hidden", () => { + expect(resolveBrowserCaptureCursorPolicy({ platform: "linux" })).toEqual({ + streamCursor: "never", + hideOsCursorBeforeRecording: false, + hideEditorOverlayCursorByDefault: false, + }); + }); + + it("still enables the editor overlay on Linux when native Windows capture failed", () => { + expect( + resolveBrowserCaptureCursorPolicy({ + nativeWindowsCaptureStartFailed: true, + platform: "linux", + }), + ).toEqual({ + streamCursor: "never", + hideOsCursorBeforeRecording: false, + hideEditorOverlayCursorByDefault: false, + }); + }); }); describe("shouldUseNativeWindowsCaptureForSource", () => { diff --git a/src/hooks/useScreenRecorder.ts b/src/hooks/useScreenRecorder.ts index dc6b70321..e8a46d3bd 100644 --- a/src/hooks/useScreenRecorder.ts +++ b/src/hooks/useScreenRecorder.ts @@ -190,9 +190,24 @@ export function normalizeBrowserMicrophoneProfile(value?: string | null): Browse export function resolveBrowserCaptureCursorPolicy({ nativeWindowsCaptureStartFailed = false, + platform = "", }: { nativeWindowsCaptureStartFailed?: boolean; + platform?: string; } = {}): BrowserCaptureCursorPolicy { + if (platform === "linux") { + // Linux browser capture runs through xdg-desktop-portal/PipeWire, which + // offers no way to hide the OS cursor globally and typically embeds it + // in the stream even when "never" is requested. Keep the telemetry + // overlay enabled by default and let the editor's "Show cursor" toggle + // turn it off for users who dislike the double cursor. + return { + streamCursor: "never", + hideOsCursorBeforeRecording: false, + hideEditorOverlayCursorByDefault: false, + }; + } + if (nativeWindowsCaptureStartFailed) { // If WGC already failed, avoid the telemetry overlay path that can lag on // constrained Windows systems; keep the browser-captured cursor instead. @@ -1921,8 +1936,10 @@ export function useScreenRecorder(): UseScreenRecorderReturn { resetRecordingClock(recordingSessionTimestamp.current); } + const platform = (await window.electronAPI?.getPlatform?.()) ?? ""; const browserCursorPolicy = resolveBrowserCaptureCursorPolicy({ nativeWindowsCaptureStartFailed, + platform, }); hideEditorOverlayCursorByDefault.current = browserCursorPolicy.hideEditorOverlayCursorByDefault;