summaryrefslogtreecommitdiffstats
path: root/src/core/media_capture_devices_dispatcher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/media_capture_devices_dispatcher.cpp')
-rw-r--r--src/core/media_capture_devices_dispatcher.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/core/media_capture_devices_dispatcher.cpp b/src/core/media_capture_devices_dispatcher.cpp
index 5298e29cf..b6e59f3bb 100644
--- a/src/core/media_capture_devices_dispatcher.cpp
+++ b/src/core/media_capture_devices_dispatcher.cpp
@@ -114,7 +114,16 @@ void getDevicesForDesktopCapture(
content::DesktopMediaID getDefaultScreenId()
{
-#if QT_CONFIG(webengine_webrtc)
+ // While this function is executing another thread may also want to create a
+ // DesktopCapturer [1]. Unfortunately, creating a DesktopCapturer is not
+ // thread safe on X11 due to the use of webrtc::XErrorTrap. It's safe to
+ // disable this code on X11 since we don't actually need to create a
+ // DesktopCapturer to get the screen id anyway
+ // (ScreenCapturerLinux::GetSourceList always returns 0 as the id).
+ //
+ // [1]: webrtc::InProcessVideoCaptureDeviceLauncher::DoStartDesktopCaptureOnDeviceThread
+
+#if QT_CONFIG(webengine_webrtc) && !defined(USE_X11)
// Source id patterns are different across platforms.
// On Linux, the hardcoded value "0" is used.
// On Windows, the screens are enumerated consecutively in increasing order from 0.