Fix screenshare portals linux
All checks were successful
Queue Release Build / prepare (push) Successful in 14s
Queue Release Build / build-windows (push) Successful in 34m25s
Queue Release Build / build-linux (push) Successful in 40m26s
Queue Release Build / finalize (push) Successful in 3m44s

This commit is contained in:
2026-03-11 17:54:04 +01:00
parent 7b3caa0b61
commit be465fd297
5 changed files with 104 additions and 43 deletions

View File

@@ -204,26 +204,32 @@ export function setupSystemHandlers(): void {
});
ipcMain.handle('get-sources', async () => {
const thumbnailSize = { width: 240, height: 150 };
const [screenSources, windowSources] = await Promise.all([
desktopCapturer.getSources({
types: ['screen'],
thumbnailSize
}),
desktopCapturer.getSources({
types: ['window'],
thumbnailSize,
fetchWindowIcons: true
})
]);
const sources = [...screenSources, ...windowSources];
const uniqueSources = new Map(sources.map((source) => [source.id, source]));
try {
const thumbnailSize = { width: 240, height: 150 };
const [screenSources, windowSources] = await Promise.all([
desktopCapturer.getSources({
types: ['screen'],
thumbnailSize
}),
desktopCapturer.getSources({
types: ['window'],
thumbnailSize,
fetchWindowIcons: true
})
]);
const sources = [...screenSources, ...windowSources];
const uniqueSources = new Map(sources.map((source) => [source.id, source]));
return [...uniqueSources.values()].map((source) => ({
id: source.id,
name: source.name,
thumbnail: source.thumbnail.toDataURL()
}));
return [...uniqueSources.values()].map((source) => ({
id: source.id,
name: source.name,
thumbnail: source.thumbnail.toDataURL()
}));
} catch {
// desktopCapturer.getSources fails on Wayland; return empty so the
// renderer falls through to getDisplayMedia with the system picker.
return [];
}
});
ipcMain.handle('prepare-linux-screen-share-audio-routing', async () => {