From 4d8803e7068a5db7dcef24323549da2a5a04fb24 Mon Sep 17 00:00:00 2001 From: marwan-softdev Date: Fri, 4 Sep 2026 09:02:27 +0800 Subject: [PATCH 1/2] fix(linux): enable cursor overlay by default on Linux resolveBrowserCaptureCursorPolicy force-disabled the editor cursor overlay for every browser-capture recording (hideEditorOverlayCursorByDefault: true), and the Linux browser path always uses browser capture, so the animated cursor overlay never appeared for Linux users. Make the policy platform-aware: on Linux keep the overlay enabled by default and skip the Windows-only OS-cursor hiding call. Windows and macOS behavior is unchanged. Users can still turn the overlay off with the editor's Show cursor toggle. --- src/hooks/useScreenRecorder.test.ts | 21 +++++++++++++++++++++ src/hooks/useScreenRecorder.ts | 17 +++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/src/hooks/useScreenRecorder.test.ts b/src/hooks/useScreenRecorder.test.ts index 1ddceb4e1..e8533e9fd 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 459652415..8e9606b87 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; From 2c27d91e5863d3d69d5e5cc27fa11d90a51ac01c Mon Sep 17 00:00:00 2001 From: marwan-softdev Date: Fri, 4 Sep 2026 09:02:40 +0800 Subject: [PATCH 2/2] fix(linux): pass a GL implementation current Electron accepts getGpuSwitches forced --use-gl=egl on Linux X11, but Electron 43 only accepts 'angle' for use-gl; the GPU process exited at startup (gl_factory: egl-gles2 not found in allowed implementations), which took WebGL with it and left the editor preview unable to initialize a Pixi renderer. Request --use-gl=angle instead. Behavior on Wayland (no use-gl switch) and on other platforms is unchanged. --- electron/gpuSwitches.test.ts | 2 +- electron/gpuSwitches.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/electron/gpuSwitches.test.ts b/electron/gpuSwitches.test.ts index 4cbb1cdf4..94071f6be 100644 --- a/electron/gpuSwitches.test.ts +++ b/electron/gpuSwitches.test.ts @@ -60,7 +60,7 @@ describe("getGpuSwitches", () => { it("returns the X11 EGL workaround on Linux X11", () => { expect(getGpuSwitches("linux", { XDG_SESSION_TYPE: "x11" })).toEqual({ - useGl: "egl", + useGl: "angle", disableFeatures: ["VaapiVideoDecoder", "VaapiVideoEncoder"], }); }); diff --git a/electron/gpuSwitches.ts b/electron/gpuSwitches.ts index 7b7c81ee8..5c086a71c 100644 --- a/electron/gpuSwitches.ts +++ b/electron/gpuSwitches.ts @@ -57,7 +57,7 @@ export function getGpuSwitches( if (platform === "linux") { return { - useGl: shouldForceLinuxEgl(env) ? "egl" : undefined, + ...(shouldForceLinuxEgl(env) ? { useGl: "angle" } : {}), disableFeatures: ["VaapiVideoDecoder", "VaapiVideoEncoder"], }; }