From 67d99355ca0582438428e2d70d69531baf3fd0bb Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 3 Nov 2022 14:27:42 +0400 Subject: [PATCH] Don't show empty popup menu in ListWidget. --- .../SourceFiles/history/view/history_view_list_widget.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp index 3d6feb228..c22cfef31 100644 --- a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp @@ -2527,6 +2527,10 @@ void ListWidget::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { _overState)); _menu = FillContextMenu(this, request); + if (_menu->empty()) { + _menu = nullptr; + return; + } using namespace HistoryView::Reactions; const auto desiredPosition = e->globalPos(); @@ -3259,6 +3263,7 @@ void ListWidget::mouseActionUpdate() { view ? view->height() : 0, itemPoint, view ? view->pointState(itemPoint) : PointState::Outside); + _overItemExact = nullptr; const auto viewChanged = (_overElement != view); if (viewChanged) { repaintItem(_overElement);