diff --git a/src/widgets/BaseWindow.cpp b/src/widgets/BaseWindow.cpp index 252f724af..fd7603ec0 100644 --- a/src/widgets/BaseWindow.cpp +++ b/src/widgets/BaseWindow.cpp @@ -157,12 +157,12 @@ void BaseWindow::init() // fourtf: don't ask me why we need to delay this if (!(this->flags_ & Flags::TopMost)) { QTimer::singleShot(1, this, [this] { - this->connections_.managedConnect( - getApp()->settings->windowTopMost.getValueChangedSignal(), + getApp()->settings->windowTopMost.connect( [this](bool topMost, auto) { ::SetWindowPos(HWND(this->winId()), topMost ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); - }); + }, + this->managedConnections); }); } #else diff --git a/src/widgets/BaseWindow.hpp b/src/widgets/BaseWindow.hpp index f4505ec0d..5873ca1ac 100644 --- a/src/widgets/BaseWindow.hpp +++ b/src/widgets/BaseWindow.hpp @@ -94,6 +94,7 @@ private: } ui_; pajlada::Signals::SignalHolder connections_; + std::vector managedConnections; }; } // namespace chatterino