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