diff --git a/Telegram/SourceFiles/calls/group/calls_group_call.cpp b/Telegram/SourceFiles/calls/group/calls_group_call.cpp index e823dc0492..4b88c44bdd 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_call.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_call.cpp @@ -951,10 +951,15 @@ void GroupCall::markEndpointActive(VideoEndpoint endpoint, bool active) { } void GroupCall::markTrackShown(const VideoEndpoint &endpoint, bool shown) { - if ((shown && _shownVideoTracks.emplace(endpoint).second) - || (!shown && _shownVideoTracks.remove(endpoint))) { + const auto changed = shown + ? _shownVideoTracks.emplace(endpoint).second + : _shownVideoTracks.remove(endpoint); + if (changed) { _videoStreamShownUpdates.fire_copy({ endpoint, shown }); } + if (shown && changed && endpoint.type == VideoEndpointType::Screen) { + pinVideoEndpoint(endpoint); + } } void GroupCall::rejoin() {