From c53d9c532f9484580e3ddd5783d598fb8acd6636 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 30 Nov 2020 21:08:27 +0300 Subject: [PATCH] Delayed mic init in group call settings. --- .../SourceFiles/calls/calls_group_panel.cpp | 6 +----- .../SourceFiles/calls/calls_group_settings.cpp | 17 ++++++++++++----- Telegram/lib_ui | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Telegram/SourceFiles/calls/calls_group_panel.cpp b/Telegram/SourceFiles/calls/calls_group_panel.cpp index 1a91692e78..f75d7de2cf 100644 --- a/Telegram/SourceFiles/calls/calls_group_panel.cpp +++ b/Telegram/SourceFiles/calls/calls_group_panel.cpp @@ -255,9 +255,7 @@ void GroupPanel::initWindow() { _window->setWindowIcon( QIcon(QPixmap::fromImage(Image::Empty()->original(), Qt::ColorOnly))); _window->setTitleStyle(st::callTitle); - _window->setTitle(computeTitleRect() - ? u" "_q - : tr::lng_group_call_title(tr::now)); + _window->setTitle(tr::lng_group_call_title(tr::now)); base::install_event_filter(_window.get(), [=](not_null e) { if (e->type() == QEvent::Close && handleClose()) { @@ -590,7 +588,6 @@ void GroupPanel::refreshTitle() { tr::lng_group_call_title(), st::groupCallHeaderLabel); _title->setAttribute(Qt::WA_TransparentForMouseEvents); - _window->setTitle(u" "_q); } const auto best = _title->naturalWidth(); const auto from = (widget()->width() - best) / 2; @@ -611,7 +608,6 @@ void GroupPanel::refreshTitle() { } } else if (_title) { _title.destroy(); - _window->setTitle(tr::lng_group_call_title(tr::now)); } } diff --git a/Telegram/SourceFiles/calls/calls_group_settings.cpp b/Telegram/SourceFiles/calls/calls_group_settings.cpp index 5a4246c167..5d1383303b 100644 --- a/Telegram/SourceFiles/calls/calls_group_settings.cpp +++ b/Telegram/SourceFiles/calls/calls_group_settings.cpp @@ -101,10 +101,6 @@ void GroupCallSettingsBox( AddSkip(layout); } - state->levelUpdateTimer.callEach(kMicTestUpdateInterval); - state->micTester = std::make_unique( - settings.callInputDeviceId()); - AddButtonWithLabel( layout, tr::lng_group_call_speakers(), @@ -136,7 +132,9 @@ void GroupCallSettingsBox( const QString &id, const QString &name) { state->inputNameStream.fire_copy(name); - state->micTester->setDeviceId(id); + if (state->micTester) { + state->micTester->setDeviceId(id); + } }), &st::groupCallCheckbox, &st::groupCallRadio)); }); @@ -214,6 +212,15 @@ void GroupCallSettingsBox( }); } + box->setShowFinishedCallback([=] { + // Means we finished showing the box. + crl::on_main(box, [=] { + state->micTester = std::make_unique( + Core::App().settings().callInputDeviceId()); + state->levelUpdateTimer.callEach(kMicTestUpdateInterval); + }); + }); + box->setTitle(tr::lng_group_call_settings_title()); box->boxClosing( ) | rpl::start_with_next([=] { diff --git a/Telegram/lib_ui b/Telegram/lib_ui index c4df097339..7fd90cb38b 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit c4df097339aa7edf1d7aadde4df4a954971a3afb +Subproject commit 7fd90cb38b6b1069af43039f93c991fffaf8ddea