mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-29 01:05:37 +00:00
Previously on Linux/Wayland, starting a fullscreen recording required three separate picker interactions: an in-app source dropdown plus two xdg-desktop-portal dialogs. The duplicate portal dialogs were caused by: 1. resolveBrowserCaptureSource() calling desktopCapturer.getSources() in the renderer, which itself triggers the portal on Wayland. 2. setDisplayMediaRequestHandler() in main also calling getSources(), which triggers another portal. 3. Returning a pre-enumerated source id to Chromium, which on Wayland is stale and forces Chromium to re-prompt via the portal during MediaStream creation. Additionally, the editor window failed to appear after recording on some Wayland sessions because 'ready-to-show' did not fire reliably. Changes: - LaunchWindow: skip the in-app source dropdown on Linux and start recording directly; the OS portal becomes the source picker. - useScreenRecorder: introduce a 'screen:linux-portal' sentinel source. When set, route capture through navigator.mediaDevices.getDisplayMedia() so the portal handles selection in a single dialog. Skip resolveBrowserCaptureSource for the sentinel to avoid an extra getSources() call. - electron/main: in setDisplayMediaRequestHandler, when the sentinel is set, skip desktopCapturer.getSources() entirely and return a synthetic source so Chromium opens the portal exactly once for the actual capture. - electron/windows: in createEditorWindow, also call win.show() from did-finish-load as a fallback for Linux/Wayland where ready-to-show may not fire.