diff --git a/src/widgets/Window.cpp b/src/widgets/Window.cpp index a1a646c4b6d..f7df6bcb0e0 100644 --- a/src/widgets/Window.cpp +++ b/src/widgets/Window.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -112,6 +113,12 @@ bool Window::event(QEvent *event) } case QEvent::WindowDeactivate: { + for (const auto &split : + this->notebook_->getSelectedPage()->getSplits()) + { + split->unpause(); + } + auto *page = this->notebook_->getSelectedPage(); if (page != nullptr) diff --git a/src/widgets/splits/Split.cpp b/src/widgets/splits/Split.cpp index 36c6888d4de..9d4ff5ed46f 100644 --- a/src/widgets/splits/Split.cpp +++ b/src/widgets/splits/Split.cpp @@ -1599,6 +1599,13 @@ void Split::setInputReply(const MessagePtr &reply) this->input_->setReply(reply); } +void Split::unpause() +{ + this->view_->unpause(PauseReason::KeyboardModifier); + this->view_->unpause(PauseReason::DoubleClick); + // Mouse intentionally left out, we may still have the mouse over the split +} + } // namespace chatterino QDebug operator<<(QDebug dbg, const chatterino::Split &split) diff --git a/src/widgets/splits/Split.hpp b/src/widgets/splits/Split.hpp index bc98de5e708..ab6322d5cdd 100644 --- a/src/widgets/splits/Split.hpp +++ b/src/widgets/splits/Split.hpp @@ -77,6 +77,9 @@ class Split : public BaseWidget void setInputReply(const MessagePtr &reply); + // This is called on window focus lost + void unpause(); + static pajlada::Signals::Signal modifierStatusChanged; static Qt::KeyboardModifiers modifierStatus;