From b639a6c48a9bba3ea489649438d0bafc05de188c Mon Sep 17 00:00:00 2001 From: stransky Date: Tue, 10 Nov 2020 16:30:41 +0000 Subject: [PATCH] Bug 1675767 [Linux] Use PipeWire on Wayland desktop, r=dminor Differential Revision: https://phabricator.services.mozilla.com/D96587 --- .../desktop_capture/desktop_capturer.cc | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capturer.cc b/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capturer.cc index 891af8e76519..5e4dcb058d16 100644 --- a/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capturer.cc +++ b/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capturer.cc @@ -77,19 +77,7 @@ std::unique_ptr DesktopCapturer::CreateTabCapturer( } #if defined(WEBRTC_USE_PIPEWIRE) || defined(USE_X11) -// Return true if Firefox is actually running with Wayland backend. -static bool IsWaylandDisplayUsed() { - const auto display = gdk_display_get_default(); - if (display == nullptr) { - // We're running in headless mode. - return false; - } - return !GDK_IS_X11_DISPLAY(display); -} - -// Return true if Firefox is actually running on Wayland enabled session. -// It means some screensharing capabilities may be limited. -static bool IsWaylandSessionUsed() { +bool DesktopCapturer::IsRunningUnderWayland() { const char* xdg_session_type = getenv("XDG_SESSION_TYPE"); if (!xdg_session_type || strncmp(xdg_session_type, "wayland", 7) != 0) return false; @@ -99,10 +87,6 @@ static bool IsWaylandSessionUsed() { return true; } - -bool DesktopCapturer::IsRunningUnderWayland() { - return IsWaylandSessionUsed() ? IsWaylandDisplayUsed() : false; -} #endif // defined(WEBRTC_USE_PIPEWIRE) || defined(USE_X11) } // namespace webrtc