From 8fa89b40731c169e52a386e29f9bd6971fee7ae2 Mon Sep 17 00:00:00 2001 From: kornes <28986062+kornes@users.noreply.github.com> Date: Sat, 12 Nov 2022 17:10:21 +0000 Subject: [PATCH] Fix context menu not opening when username is right clicked from usercard/search/reply window (#4122) Co-authored-by: pajlada --- CHANGELOG.md | 1 + src/widgets/helper/ChannelView.cpp | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f2487037..a6969cf86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -84,6 +84,7 @@ - Bugfix: Fixed `Add new account` dialog causing main chatterino window to be non movable. (#4121) - Bugfix: Connection to Twitch PubSub now recovers more reliably. (#3643, #3716) - Bugfix: Fixed `Smooth scrolling on new messages` setting sometimes hiding messages. (#4028) +- Bugfix: Fixed context menu not opening when username is right clicked from usercard/search/reply window. (#4122) - Bugfix: Fixed a crash that can occur when closing and quickly reopening a split, then running a command. (#3852) - Bugfix: Fixed a crash that can occur when changing channels. (#3799) - Bugfix: Fixed viewers list search not working when used before loading finishes. (#3774) diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index e0944684a..c42fe0462 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -1991,16 +1991,17 @@ void ChannelView::handleMouseClick(QMouseEvent *event, } break; case Qt::RightButton: { - auto split = dynamic_cast(this->parentWidget()); - auto insertText = [=](QString text) { - if (split) - { - split->insertTextToInput(text); - } - }; - - if (hoveredElement != nullptr) + // insert user mention to input, only in default context + if ((this->context_ == Context::None) && + (hoveredElement != nullptr)) { + auto split = dynamic_cast(this->parentWidget()); + auto insertText = [=](QString text) { + if (split) + { + split->insertTextToInput(text); + } + }; const auto &link = hoveredElement->getLink(); if (link.type == Link::UserInfo)