diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 4fa82cde06..955d41eba6 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -5709,7 +5709,9 @@ bool HistoryWidget::searchInChatEmbedded( Dialogs::Key chat, PeerData *searchFrom) { const auto peer = chat.peer(); // windows todo - if (!peer || Window::SeparateId(peer) != controller()->windowId()) { + if (!peer + || ((Window::SeparateId(peer) != controller()->windowId()) + && !controller()->isPrimary())) { return false; } else if (_peer != peer) { const auto weak = base::make_weak(this); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 1451e257e5..13e91cf2d3 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -70,6 +70,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "media/player/media_player_dropdown.h" #include "media/player/media_player_instance.h" #include "base/qthelp_regex.h" +#include "base/options.h" #include "mtproto/mtproto_dc_options.h" #include "core/update_checker.h" #include "core/shortcuts.h" @@ -105,8 +106,16 @@ void ClearBotStartToken(PeerData *peer) { } } +base::options::toggle ForceComposeSearchOneColumn({ + .id = kForceComposeSearchOneColumn, + .name = "Force embedded search in chats", + .description = "Force in one-column mode the embedded search in chats.", +}); + } // namespace +const char kForceComposeSearchOneColumn[] = "force-compose-search-one-column"; + enum StackItemType { HistoryStackItem, SectionStackItem, @@ -782,7 +791,8 @@ void MainWidget::searchMessages( return; } auto tags = Data::SearchTagsFromQuery(query); - if (_dialogs) { + if (_dialogs + && (!ForceComposeSearchOneColumn.value() || !isOneColumn())) { auto state = Dialogs::SearchState{ .inChat = ((tags.empty() || inChat.sublist()) ? inChat diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index fc9281f9fe..198d2fffee 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -92,6 +92,8 @@ namespace Core { class Changelogs; } // namespace Core +extern const char kForceComposeSearchOneColumn[]; + class MainWidget final : public Ui::RpWidget , private Media::Player::FloatDelegate { diff --git a/Telegram/SourceFiles/settings/settings_experimental.cpp b/Telegram/SourceFiles/settings/settings_experimental.cpp index f65f2c77af..6a23ef9dd6 100644 --- a/Telegram/SourceFiles/settings/settings_experimental.cpp +++ b/Telegram/SourceFiles/settings/settings_experimental.cpp @@ -28,6 +28,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "info/profile/info_profile_actions.h" #include "lang/lang_keys.h" #include "mainwindow.h" +#include "mainwidget.h" #include "media/player/media_player_instance.h" #include "mtproto/session_private.h" #include "webview/webview_embed.h" @@ -175,6 +176,7 @@ void SetupExperimental( addToggle(Window::kOptionDisableTouchbar); addToggle(Info::kAlternativeScrollProcessing); addToggle(kModerateCommonGroups); + addToggle(kForceComposeSearchOneColumn); } } // namespace