From b711fd20f235eba624afdbe34d50de4435d57dd7 Mon Sep 17 00:00:00 2001 From: webadderall <131426131+webadderall@users.noreply.github.com> Date: Mon, 16 Mar 2026 22:54:59 +1100 Subject: [PATCH] Revert "fix(macos): keep sources visible when thumbnails are unavailable" This reverts commit f3dca8a2bb771fc14d3861129e426fd4b355080e. --- electron/ipc/handlers.ts | 11 ++++++----- src/components/launch/SourceSelector.tsx | 17 +++++------------ 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/electron/ipc/handlers.ts b/electron/ipc/handlers.ts index 1416238a..00f0da6e 100644 --- a/electron/ipc/handlers.ts +++ b/electron/ipc/handlers.ts @@ -1634,6 +1634,7 @@ export function registerIpcHandlers( if (process.platform !== 'darwin' || !includeWindows) { const windowSources = electronSources .filter((source) => source.id.startsWith('window:')) + .filter((source) => hasUsableSourceThumbnail(source.thumbnail)) .filter((source) => { const normalizedName = normalizeDesktopSourceName(source.name) if (!normalizedName) { @@ -1657,7 +1658,7 @@ export function registerIpcHandlers( id: source.id, name: source.name, display_id: source.display_id, - thumbnail: hasUsableSourceThumbnail(source.thumbnail) ? source.thumbnail!.toDataURL() : null, + thumbnail: source.thumbnail ? source.thumbnail.toDataURL() : null, appIcon: source.appIcon ? source.appIcon.toDataURL() : null, })) @@ -1704,14 +1705,13 @@ export function registerIpcHandlers( id: source.id, name: source.name, display_id: source.display_id ?? electronWindowSource?.display_id ?? '', - thumbnail: hasUsableSourceThumbnail(electronWindowSource?.thumbnail) - ? electronWindowSource!.thumbnail.toDataURL() - : null, + thumbnail: electronWindowSource?.thumbnail ? electronWindowSource.thumbnail.toDataURL() : null, appIcon: source.appIcon ?? (electronWindowSource?.appIcon ? electronWindowSource.appIcon.toDataURL() : null), appName: source.appName, windowTitle: source.windowTitle, } }) + .filter((source) => Boolean(source.thumbnail)) return [...screenSources, ...mergedWindowSources] } catch (error) { @@ -1719,6 +1719,7 @@ export function registerIpcHandlers( const windowSources = electronSources .filter((source) => source.id.startsWith('window:')) + .filter((source) => hasUsableSourceThumbnail(source.thumbnail)) .filter((source) => { const normalizedName = normalizeDesktopSourceName(source.name) if (!normalizedName) { @@ -1742,7 +1743,7 @@ export function registerIpcHandlers( id: source.id, name: source.name, display_id: source.display_id, - thumbnail: hasUsableSourceThumbnail(source.thumbnail) ? source.thumbnail!.toDataURL() : null, + thumbnail: source.thumbnail ? source.thumbnail.toDataURL() : null, appIcon: source.appIcon ? source.appIcon.toDataURL() : null, })) diff --git a/src/components/launch/SourceSelector.tsx b/src/components/launch/SourceSelector.tsx index 9d7b4037..9b98e329 100644 --- a/src/components/launch/SourceSelector.tsx +++ b/src/components/launch/SourceSelector.tsx @@ -153,18 +153,11 @@ export function SourceSelector() { >