diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index c5d01d8c9f..fd56b4bccb 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -2094,6 +2094,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_group_call_mac_access" = "Telegram Desktop does not have access to system wide keyboard input required for Push to Talk."; "lng_group_call_mac_input" = "Please allow **Input Monitoring** for Telegram in Privacy Settings."; "lng_group_call_mac_accessibility" = "Please allow **Accessibility** for Telegram in Privacy Settings.\n\nApp restart may be required."; +"lng_group_call_mac_screencast_access" = "Telegram Desktop does not have access to screen recording required for Screen Sharing."; +"lng_group_call_mac_recording" = "Please allow **Screen Recording** for Telegram in Privacy Settings."; "lng_group_call_mac_settings" = "Open Settings"; "lng_group_call_start_as_header" = "Start Voice Chat as..."; diff --git a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp index 3974850b2a..b411889e11 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp @@ -1052,12 +1052,46 @@ void Panel::refreshTopButton() { } } +void Panel::screenSharingPrivacyRequest() { +#ifdef Q_OS_MAC + if (!Platform::IsMac10_15OrGreater()) { + return; + } + const auto requestInputMonitoring = Platform::IsMac10_15OrGreater(); + _layerBg->showBox(Box([=](not_null box) { + box->addRow( + object_ptr( + box.get(), + rpl::combine( + tr::lng_group_call_mac_screencast_access(), + tr::lng_group_call_mac_recording() + ) | rpl::map([](QString a, QString b) { + auto result = Ui::Text::RichLangValue(a); + result.append("\n\n").append(Ui::Text::RichLangValue(b)); + return result; + }), + st::groupCallBoxLabel), + style::margins( + st::boxRowPadding.left(), + st::boxPadding.top(), + st::boxRowPadding.right(), + st::boxPadding.bottom())); + box->addButton(tr::lng_group_call_mac_settings(), [=] { + Platform::OpenDesktopCapturePrivacySettings(); + }); + box->addButton(tr::lng_cancel(), [=] { box->closeBox(); }); + })); +#endif // Q_OS_MAC +} + void Panel::chooseShareScreenSource() { if (_call->emitShareScreenError()) { return; } const auto choose = [=] { - if (const auto source = Webrtc::UniqueDesktopCaptureSource()) { + if (!Webrtc::DesktopCaptureAllowed()) { + screenSharingPrivacyRequest(); + } else if (const auto source = Webrtc::UniqueDesktopCaptureSource()) { if (_call->isSharingScreen()) { _call->toggleScreenSharing(std::nullopt); } else { diff --git a/Telegram/SourceFiles/calls/group/calls_group_panel.h b/Telegram/SourceFiles/calls/group/calls_group_panel.h index 1ef0359095..4383b510c4 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_panel.h +++ b/Telegram/SourceFiles/calls/group/calls_group_panel.h @@ -134,6 +134,7 @@ private: void showMainMenu(); void chooseJoinAs(); void chooseShareScreenSource(); + void screenSharingPrivacyRequest(); void addMembers(); void kickParticipant(not_null participantPeer); void kickParticipantSure(not_null participantPeer); diff --git a/Telegram/SourceFiles/calls/group/ui/desktop_capture_choose_source.cpp b/Telegram/SourceFiles/calls/group/ui/desktop_capture_choose_source.cpp index a8320c4cb4..2203195b03 100644 --- a/Telegram/SourceFiles/calls/group/ui/desktop_capture_choose_source.cpp +++ b/Telegram/SourceFiles/calls/group/ui/desktop_capture_choose_source.cpp @@ -298,9 +298,9 @@ void ChooseSourceProcess::activate() { void ChooseSourceProcess::setupPanel() { #ifndef Q_OS_LINUX - _window->setAttribute(Qt::WA_OpaquePaintEvent); + //_window->setAttribute(Qt::WA_OpaquePaintEvent); #endif // Q_OS_LINUX - _window->setAttribute(Qt::WA_NoSystemBackground); + //_window->setAttribute(Qt::WA_NoSystemBackground); _window->setWindowIcon(QIcon( QPixmap::fromImage(Image::Empty()->original(), Qt::ColorOnly))); @@ -322,7 +322,7 @@ void ChooseSourceProcess::setupPanel() { + (st::desktopCaptureSourceSize.height() / 2) + bottomHeight; _window->setFixedSize({ width, height }); - _window->setWindowFlag(Qt::WindowStaysOnTopHint); + _window->setStaysOnTop(true); _window->body()->paintRequest( ) | rpl::start_with_next([=](QRect clip) { diff --git a/Telegram/lib_base b/Telegram/lib_base index 43e10864ac..846282f36f 160000 --- a/Telegram/lib_base +++ b/Telegram/lib_base @@ -1 +1 @@ -Subproject commit 43e10864ac0b636457911c63ecd3e2429d38d339 +Subproject commit 846282f36fc4270a1d6b926163d104b40800e781 diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 7bc9e12614..1c004580eb 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 7bc9e1261498af07475f4bac0d8bcd8721202177 +Subproject commit 1c004580ebb1380d3cb19fadb017f416c85a0eef diff --git a/Telegram/lib_webrtc b/Telegram/lib_webrtc index 539b9b51c7..8926a5bbcb 160000 --- a/Telegram/lib_webrtc +++ b/Telegram/lib_webrtc @@ -1 +1 @@ -Subproject commit 539b9b51c730900ce724d2e329f3a877f2fcba30 +Subproject commit 8926a5bbcbfa598f43be6c5a4b4762c2dd74b7e6