only pass partial info

This commit is contained in:
V 2023-08-07 00:48:23 +02:00
parent b87bcaefe9
commit f7b7931847
No known key found for this signature in database
GPG key ID: A1DC0CFB5615D905

View file

@ -33,18 +33,18 @@ export function registerScreenShareHandler() {
process.platform === "linux" && process.platform === "linux" &&
(process.env.XDG_SESSION_TYPE === "wayland" || !!process.env.WAYLAND_DISPLAY); (process.env.XDG_SESSION_TYPE === "wayland" || !!process.env.WAYLAND_DISPLAY);
if (isWayland) {
const video = sources[0];
callback(video ? { video } : {});
return;
}
const data = sources.map(({ id, name, thumbnail }) => ({ const data = sources.map(({ id, name, thumbnail }) => ({
id, id,
name, name,
url: thumbnail.toDataURL() url: thumbnail.toDataURL()
})); }));
if (isWayland) {
const video = data[0];
callback(video ? { video } : {});
return;
}
const choice = await request.frame const choice = await request.frame
.executeJavaScript(`Vesktop.Components.ScreenShare.openScreenSharePicker(${JSON.stringify(data)})`) .executeJavaScript(`Vesktop.Components.ScreenShare.openScreenSharePicker(${JSON.stringify(data)})`)
.then(e => e as StreamPick) .then(e => e as StreamPick)