Skip to content

Commit

Permalink
fix: ReplyThreadPopup now requires a split as its parent (#5036)
Browse files Browse the repository at this point in the history
Co-authored-by: Nerixyz <[email protected]>
  • Loading branch information
pajlada and Nerixyz authored Dec 17, 2023
1 parent 5dd8c1c commit 0395b69
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
- Bugfix: Fixed support for Windows 11 Snap layouts. (#4994)
- Bugfix: Fixed some windows appearing between screens. (#4797)
- Bugfix: Fixed a crash that could occur when using certain features in a Usercard after closing the split from which it was created. (#5034)
- Bugfix: Fixed a crash that could occur when using certain features in a Reply popup after closing the split from which it was created. (#5036)
- Bugfix: Fixed a bug on Wayland where tooltips would spawn as separate windows instead of behaving like tooltips. (#4998)
- Bugfix: Fixes to section deletion in text input fields. (#5013)
- Bugfix: Show user text input within watch streak notices. (#5029)
Expand Down
7 changes: 4 additions & 3 deletions src/widgets/dialogs/ReplyThreadPopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ const QString TEXT_TITLE("Reply Thread - @%1 in #%2");

namespace chatterino {

ReplyThreadPopup::ReplyThreadPopup(bool closeAutomatically, QWidget *parent,
Split *split)
: DraggablePopup(closeAutomatically, parent)
ReplyThreadPopup::ReplyThreadPopup(bool closeAutomatically, Split *split)
: DraggablePopup(closeAutomatically, split)
, split_(split)
{
assert(split != nullptr);

this->setWindowTitle(QStringLiteral("Reply Thread"));

HotkeyController::HotkeyMap actions{
Expand Down
6 changes: 5 additions & 1 deletion src/widgets/dialogs/ReplyThreadPopup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ class ReplyThreadPopup final : public DraggablePopup
Q_OBJECT

public:
ReplyThreadPopup(bool closeAutomatically, QWidget *parent, Split *split);
/**
* @param closeAutomatically Decides whether the popup should close when it loses focus
* @param split Will be used as the popup's parent. Must not be null
*/
explicit ReplyThreadPopup(bool closeAutomatically, Split *split);

void setThread(std::shared_ptr<MessageThread> thread);
void giveFocus(Qt::FocusReason reason);
Expand Down
6 changes: 2 additions & 4 deletions src/widgets/helper/ChannelView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2917,10 +2917,8 @@ void ChannelView::showReplyThreadPopup(const MessagePtr &message)
return;
}

auto *popupParent =
static_cast<QWidget *>(&(getApp()->windows->getMainWindow()));
auto *popup = new ReplyThreadPopup(getSettings()->autoCloseThreadPopup,
popupParent, this->split_);
auto *popup =
new ReplyThreadPopup(getSettings()->autoCloseThreadPopup, this->split_);

popup->setThread(message->replyThread);

Expand Down

0 comments on commit 0395b69

Please sign in to comment.