diff --git a/CHANGELOG.md b/CHANGELOG.md index fbe436bb..3777a74a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unversioned - Bugfix: Fixed being unable to see the usercard of VIPs who have Asian language display names. (#4174) +- Bugfix: Fixed the wrong right-click menu showing in the chat input box. (#4177) ## 2.4.0-beta diff --git a/src/widgets/splits/SplitInput.cpp b/src/widgets/splits/SplitInput.cpp index cfc5a3fd..053d7591 100644 --- a/src/widgets/splits/SplitInput.cpp +++ b/src/widgets/splits/SplitInput.cpp @@ -648,6 +648,16 @@ void SplitInput::installKeyPressedEvent() }); } +void SplitInput::mousePressEvent(QMouseEvent *event) +{ + if (this->hidden) + { + BaseWidget::mousePressEvent(event); + } + // else, don't call QWidget::mousePressEvent, + // which will call event->ignore() +} + void SplitInput::onTextChanged() { this->updateCompletionPopup(); diff --git a/src/widgets/splits/SplitInput.hpp b/src/widgets/splits/SplitInput.hpp index 164d8de1..1cba4140 100644 --- a/src/widgets/splits/SplitInput.hpp +++ b/src/widgets/splits/SplitInput.hpp @@ -87,6 +87,8 @@ protected: void paintEvent(QPaintEvent * /*event*/) override; void resizeEvent(QResizeEvent * /*event*/) override; + void mousePressEvent(QMouseEvent *event) override; + virtual void giveFocus(Qt::FocusReason reason); QString handleSendMessage(std::vector &arguments);