From d2e600352160420314721b76817988b80d1f3433 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 29 May 2024 10:12:56 +0400 Subject: [PATCH] Ignore right click on preview. --- .../view/history_view_chat_preview.cpp | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Telegram/SourceFiles/history/view/history_view_chat_preview.cpp b/Telegram/SourceFiles/history/view/history_view_chat_preview.cpp index b804f73824..8ad2a2a6ab 100644 --- a/Telegram/SourceFiles/history/view/history_view_chat_preview.cpp +++ b/Telegram/SourceFiles/history/view/history_view_chat_preview.cpp @@ -426,16 +426,19 @@ void Item::setupHistory() { _scroll->events() | rpl::start_with_next([=](not_null e) { if (e->type() == QEvent::MouseButtonPress) { - const auto relative = Ui::MapFrom( - _inner.data(), - _scroll.get(), - static_cast(e.get())->pos()); - if (const auto view = _inner->lookupItemByY(relative.y())) { - _actions.fire(ChatPreviewAction{ - .openItemId = view->data()->fullId(), - }); - } else { - _actions.fire(ChatPreviewAction{}); + const auto button = static_cast(e.get())->button(); + if (button == Qt::LeftButton) { + const auto relative = Ui::MapFrom( + _inner.data(), + _scroll.get(), + static_cast(e.get())->pos()); + if (const auto view = _inner->lookupItemByY(relative.y())) { + _actions.fire(ChatPreviewAction{ + .openItemId = view->data()->fullId(), + }); + } else { + _actions.fire(ChatPreviewAction{}); + } } } }, lifetime());