From e8f16840dee035a07fbe898b6c0fdc63316e7a73 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 30 Jun 2024 10:26:35 +0400 Subject: [PATCH] Fix wrong search focusing. Fixes #28052. --- Telegram/SourceFiles/history/history_widget.cpp | 3 ++- Telegram/SourceFiles/history/history_widget.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 164909c20..fe0610daf 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -1855,12 +1855,13 @@ void HistoryWidget::setInnerFocus() { if (_list) { if (isSearching()) { _composeSearch->setInnerFocus(); - } else if (_chooseTheme && _chooseTheme->shouldBeShown()) { + } else if (isChoosingTheme()) { _chooseTheme->setFocus(); } else if (_showAnimation || _nonEmptySelection || (_list && _list->wasSelectedText()) || isRecording() + || isJoinChannel() || isBotStart() || isBlocked() || (!_canSendTexts && !_editMsgId)) { diff --git a/Telegram/SourceFiles/history/history_widget.h b/Telegram/SourceFiles/history/history_widget.h index 977415fba..b90ef037d 100644 --- a/Telegram/SourceFiles/history/history_widget.h +++ b/Telegram/SourceFiles/history/history_widget.h @@ -504,7 +504,7 @@ private: int countMembersDropdownHeightMax() const; void updateReplyToName(); - bool editingMessage() const { + [[nodiscard]] bool editingMessage() const { return _editMsgId != 0; }