diff --git a/Telegram/SourceFiles/history/view/history_view_chat_preview.cpp b/Telegram/SourceFiles/history/view/history_view_chat_preview.cpp index 118474695..4747ce609 100644 --- a/Telegram/SourceFiles/history/view/history_view_chat_preview.cpp +++ b/Telegram/SourceFiles/history/view/history_view_chat_preview.cpp @@ -509,6 +509,10 @@ void Item::setupHistory() { _inner->refreshViewer(); _inner->setAttribute(Qt::WA_TransparentForMouseEvents); + + crl::on_main(this, [=] { + _inner->setFocus(); + }); } void Item::paintEvent(QPaintEvent *e) { @@ -537,6 +541,7 @@ bool Item::listScrollTo(int top, bool syntetic) { } void Item::listCancelRequest() { + _actions.fire({ .cancel = true }); } void Item::listDeleteRequest() { diff --git a/Telegram/SourceFiles/history/view/history_view_chat_preview.h b/Telegram/SourceFiles/history/view/history_view_chat_preview.h index 0598725c2..fa9e582a0 100644 --- a/Telegram/SourceFiles/history/view/history_view_chat_preview.h +++ b/Telegram/SourceFiles/history/view/history_view_chat_preview.h @@ -21,6 +21,7 @@ namespace HistoryView { struct ChatPreviewAction { FullMsgId openItemId; + bool cancel = false; bool openInfo = false; bool markRead = false; bool markUnread = false; diff --git a/Telegram/SourceFiles/window/window_chat_preview.cpp b/Telegram/SourceFiles/window/window_chat_preview.cpp index e95d58d4c..2a9607acc 100644 --- a/Telegram/SourceFiles/window/window_chat_preview.cpp +++ b/Telegram/SourceFiles/window/window_chat_preview.cpp @@ -64,7 +64,8 @@ bool ChatPreviewManager::show( if (const auto thread = weakThread.get()) { const auto itemId = action.openItemId; const auto owner = &thread->owner(); - if (action.markRead) { + if (action.cancel) { + } else if (action.markRead) { MarkAsReadThread(thread); } else if (action.markUnread) { if (const auto history = thread->asHistory()) { diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 4ae0ffe56..bc5f66913 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 4ae0ffe56efb20f795062713780c79e79cd39879 +Subproject commit bc5f66913dbc4e68d2d4314240d68df681284d3b