fixed screensharing under wayland, but caused other issues by updating electron to 26.2.3
This commit is contained in:
parent
d717e9de5d
commit
bc7d802b24
4 changed files with 10 additions and 10 deletions
|
@ -33,7 +33,7 @@
|
||||||
"@typescript-eslint/parser": "^6.2.1",
|
"@typescript-eslint/parser": "^6.2.1",
|
||||||
"@vencord/types": "^0.1.2",
|
"@vencord/types": "^0.1.2",
|
||||||
"dotenv": "^16.3.1",
|
"dotenv": "^16.3.1",
|
||||||
"electron": "^25.8.2",
|
"electron": "26.2.3",
|
||||||
"electron-builder": "^24.6.3",
|
"electron-builder": "^24.6.3",
|
||||||
"esbuild": "^0.18.17",
|
"esbuild": "^0.18.17",
|
||||||
"eslint": "^8.46.0",
|
"eslint": "^8.46.0",
|
||||||
|
|
|
@ -32,8 +32,8 @@ devDependencies:
|
||||||
specifier: ^16.3.1
|
specifier: ^16.3.1
|
||||||
version: 16.3.1
|
version: 16.3.1
|
||||||
electron:
|
electron:
|
||||||
specifier: ^25.8.2
|
specifier: 26.2.3
|
||||||
version: 25.8.2
|
version: 26.2.3
|
||||||
electron-builder:
|
electron-builder:
|
||||||
specifier: ^24.6.3
|
specifier: ^24.6.3
|
||||||
version: 24.6.3
|
version: 24.6.3
|
||||||
|
@ -1766,8 +1766,8 @@ packages:
|
||||||
- supports-color
|
- supports-color
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/electron@25.8.2:
|
/electron@26.2.3:
|
||||||
resolution: {integrity: sha512-AM1ra6b16EQuO1bJtiA8ZiWqqFLLgVfxD56ykiy+EA5C63Hkx8OmIbe+5JAsLiTwRVvBZ4oCAj6wa2qT+iq8ww==}
|
resolution: {integrity: sha512-osdKf9mbhrqE81ITdvQ7TjVOayXfcAlWm8A6EtBt/eFSh7a/FijebGVkgs0S7qWQdhO0KaNZDb1Gx00sWuDQdw==}
|
||||||
engines: {node: '>= 12.20.55'}
|
engines: {node: '>= 12.20.55'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
|
|
@ -29,8 +29,8 @@ export function registerScreenShareHandler() {
|
||||||
width: 176,
|
width: 176,
|
||||||
height: 99
|
height: 99
|
||||||
}
|
}
|
||||||
});
|
}).catch(() => null);
|
||||||
|
if (sources === null) return callback({});
|
||||||
const isWayland =
|
const isWayland =
|
||||||
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);
|
||||||
|
@ -45,7 +45,7 @@ export function registerScreenShareHandler() {
|
||||||
const video = data[0];
|
const video = data[0];
|
||||||
if (video)
|
if (video)
|
||||||
await request.frame.executeJavaScript(
|
await request.frame.executeJavaScript(
|
||||||
`Vesktop.Components.ScreenShare.StreamSettings(${JSON.stringify([data])}, true)`
|
`Vesktop.Components.ScreenShare.openScreenSharePicker(${JSON.stringify([video])}, true)`
|
||||||
);
|
);
|
||||||
|
|
||||||
callback(video ? { video: sources[0] } : {});
|
callback(video ? { video: sources[0] } : {});
|
||||||
|
@ -53,7 +53,7 @@ export function registerScreenShareHandler() {
|
||||||
}
|
}
|
||||||
|
|
||||||
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)}, false)`)
|
||||||
.then(e => e as StreamPick)
|
.then(e => e as StreamPick)
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
console.error("Error during screenshare picker", e);
|
console.error("Error during screenshare picker", e);
|
||||||
|
|
|
@ -71,7 +71,7 @@ addPatch({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export function openScreenSharePicker(screens: Source[], skipPicker = false) {
|
export function openScreenSharePicker(screens: Source[], skipPicker: boolean) {
|
||||||
let didSubmit = false;
|
let didSubmit = false;
|
||||||
return new Promise<StreamPick>((resolve, reject) => {
|
return new Promise<StreamPick>((resolve, reject) => {
|
||||||
const key = openModal(
|
const key = openModal(
|
||||||
|
|
Reference in a new issue