From fef51684007af190da3ad85e41b2ef7d6ba57cc5 Mon Sep 17 00:00:00 2001 From: byquanton <32410361+byquanton@users.noreply.github.com> Date: Sun, 8 Dec 2024 17:52:58 +0100 Subject: [PATCH] WIP: Fix SourcePicker on element-desktop --- .../elements/DesktopCapturerSourcePicker.tsx | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/components/views/elements/DesktopCapturerSourcePicker.tsx b/src/components/views/elements/DesktopCapturerSourcePicker.tsx index e1f1def836..43644f835f 100644 --- a/src/components/views/elements/DesktopCapturerSourcePicker.tsx +++ b/src/components/views/elements/DesktopCapturerSourcePicker.tsx @@ -79,13 +79,31 @@ export default class DesktopCapturerSourcePicker extends React.Component { + if (this.isWayland()) { + const sources = await getDesktopCapturerSources(); + this.props.onFinished(sources[0]); // Automatically select the first source or handle accordingly + return; + } + + // window.setInterval() first waits and then executes, therefore // we call getDesktopCapturerSources() here without any delay. // Otherwise the dialog would be left empty for some time. @@ -102,7 +120,9 @@ export default class DesktopCapturerSourcePicker extends React.Component { @@ -139,6 +159,11 @@ export default class DesktopCapturerSourcePicker extends React.Component> = [ this.getTab(Tabs.Screens, _td("voip|screenshare_monitor")), this.getTab(Tabs.Windows, _td("voip|screenshare_window")),