only pass partial info
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user