fixes issue with 0245bd5

This commit is contained in:
ch-ems 2018-06-25 21:27:51 +01:00 committed by fourtf
parent 06350e9e14
commit d333da3dfa
2 changed files with 4 additions and 3 deletions

View file

@ -157,12 +157,12 @@ void BaseWindow::init()
// fourtf: don't ask me why we need to delay this // fourtf: don't ask me why we need to delay this
if (!(this->flags_ & Flags::TopMost)) { if (!(this->flags_ & Flags::TopMost)) {
QTimer::singleShot(1, this, [this] { QTimer::singleShot(1, this, [this] {
this->connections_.managedConnect( getApp()->settings->windowTopMost.connect(
getApp()->settings->windowTopMost.getValueChangedSignal(),
[this](bool topMost, auto) { [this](bool topMost, auto) {
::SetWindowPos(HWND(this->winId()), topMost ? HWND_TOPMOST : HWND_NOTOPMOST, 0, ::SetWindowPos(HWND(this->winId()), topMost ? HWND_TOPMOST : HWND_NOTOPMOST, 0,
0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
}); },
this->managedConnections);
}); });
} }
#else #else

View file

@ -94,6 +94,7 @@ private:
} ui_; } ui_;
pajlada::Signals::SignalHolder connections_; pajlada::Signals::SignalHolder connections_;
std::vector<pajlada::Signals::ScopedConnection> managedConnections;
}; };
} // namespace chatterino } // namespace chatterino