mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Fix unintentional search focus.
This commit is contained in:
@@ -1772,7 +1772,7 @@ void MainWidget::showNewSection(
|
||||
_thirdSection = std::move(newThirdSection);
|
||||
_thirdSection->removeRequests(
|
||||
) | rpl::start_with_next([=] {
|
||||
_thirdSection.destroy();
|
||||
destroyThirdSection();
|
||||
_thirdShadow.destroy();
|
||||
updateControlsGeometry();
|
||||
}, _thirdSection->lifetime());
|
||||
@@ -2289,7 +2289,7 @@ void MainWidget::updateControlsGeometry() {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
_thirdSection.destroy();
|
||||
destroyThirdSection();
|
||||
_thirdShadow.destroy();
|
||||
}
|
||||
const auto mainSectionTop = getMainSectionTop();
|
||||
@@ -2408,6 +2408,15 @@ void MainWidget::updateControlsGeometry() {
|
||||
floatPlayerUpdatePositions();
|
||||
}
|
||||
|
||||
void MainWidget::destroyThirdSection() {
|
||||
if (const auto strong = _thirdSection.data()) {
|
||||
if (Ui::InFocusChain(strong)) {
|
||||
setFocus();
|
||||
}
|
||||
}
|
||||
_thirdSection.destroy();
|
||||
}
|
||||
|
||||
void MainWidget::refreshResizeAreas() {
|
||||
if (!isOneColumn() && _dialogs) {
|
||||
ensureFirstColumnResizeAreaCreated();
|
||||
@@ -2555,7 +2564,7 @@ void MainWidget::updateThirdColumnToCurrentChat(
|
||||
if (saveThirdSectionToStackBack()) {
|
||||
_stack.back()->setThirdSectionMemento(
|
||||
_thirdSection->createMemento());
|
||||
_thirdSection.destroy();
|
||||
destroyThirdSection();
|
||||
}
|
||||
};
|
||||
auto &settings = Core::App().settings();
|
||||
@@ -2601,7 +2610,7 @@ void MainWidget::updateThirdColumnToCurrentChat(
|
||||
settings.setTabbedReplacedWithInfo(false);
|
||||
if (!key) {
|
||||
if (_thirdSection) {
|
||||
_thirdSection.destroy();
|
||||
destroyThirdSection();
|
||||
_thirdShadow.destroy();
|
||||
updateControlsGeometry();
|
||||
}
|
||||
|
Reference in New Issue
Block a user