mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
fixed crash when enabling 'window always on top'
This commit is contained in:
parent
7f5b07a9f9
commit
0245bd5c3a
|
@ -167,9 +167,11 @@ void BaseWindow::init()
|
|||
// fourtf: don't ask me why we need to delay this
|
||||
if (!(this->flags_ & Flags::TopMost)) {
|
||||
QTimer::singleShot(1, this, [this] {
|
||||
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->connections_.managedConnect(
|
||||
getApp()->settings->windowTopMost.getValueChangedSignal(),
|
||||
[this](bool topMost, auto) {
|
||||
::SetWindowPos(HWND(this->winId()), topMost ? HWND_TOPMOST : HWND_NOTOPMOST, 0,
|
||||
0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -178,7 +180,7 @@ void BaseWindow::init()
|
|||
// this->setWindowFlag(Qt::WindowStaysOnTopHint);
|
||||
// }
|
||||
#endif
|
||||
}
|
||||
} // namespace widgets
|
||||
|
||||
void BaseWindow::setStayInScreenRect(bool value)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue