diff --git a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp index 5a0acd5a17..5da7747e0a 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp @@ -53,6 +53,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "app.h" #include "apiwrap.h" // api().kickParticipant. #include "webrtc/webrtc_video_track.h" +#include "webrtc/webrtc_media_devices.h" // UniqueDesktopCaptureSource. #include "styles/style_calls.h" #include "styles/style_layers.h" @@ -1349,7 +1350,15 @@ void Panel::chooseShareScreenSource() { return; } const auto choose = [=] { - Ui::DesktopCapture::ChooseSource(this); + if (const auto source = Webrtc::UniqueDesktopCaptureSource()) { + if (_call->isSharingScreen()) { + _call->toggleScreenSharing(std::nullopt); + } else { + chooseSourceAccepted(*source); + } + } else { + Ui::DesktopCapture::ChooseSource(this); + } }; const auto screencastFromPeer = [&]() -> PeerData* { for (const auto &[endpoint, track] : _call->activeVideoTracks()) { diff --git a/Telegram/ThirdParty/tgcalls b/Telegram/ThirdParty/tgcalls index 98bef190cc..d78c12c9ca 160000 --- a/Telegram/ThirdParty/tgcalls +++ b/Telegram/ThirdParty/tgcalls @@ -1 +1 @@ -Subproject commit 98bef190cc1fc18ada3717dd0f97ae79f84d9e45 +Subproject commit d78c12c9ca0b671d5b0064d44b45e35b37ec2af1 diff --git a/Telegram/lib_webrtc b/Telegram/lib_webrtc index 26ed210ad2..45008adcd9 160000 --- a/Telegram/lib_webrtc +++ b/Telegram/lib_webrtc @@ -1 +1 @@ -Subproject commit 26ed210ad24f9a25c8f12056489bfd0ede8eac00 +Subproject commit 45008adcd949f0729c22b098251d5a861eb52373