Start sharing without source choosing in case of PipeWire.

This commit is contained in:
John Preston 2021-06-01 14:58:30 +04:00
parent 28f83f2af4
commit e6977b2c33
3 changed files with 12 additions and 3 deletions

View file

@ -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()) {

@ -1 +1 @@
Subproject commit 98bef190cc1fc18ada3717dd0f97ae79f84d9e45
Subproject commit d78c12c9ca0b671d5b0064d44b45e35b37ec2af1

@ -1 +1 @@
Subproject commit 26ed210ad24f9a25c8f12056489bfd0ede8eac00
Subproject commit 45008adcd949f0729c22b098251d5a861eb52373