From b41df1893319d1f86243eec605ddaf3fe252910d Mon Sep 17 00:00:00 2001 From: pajlada Date: Sun, 5 Dec 2021 13:38:21 +0100 Subject: [PATCH] Fixed a crash that could occur on certain Linux systems when toggling the Always on Top flag. (#3385) * Get `isVisible` value *before* toggling AlwaysOnTop hint * Add changelog entry --- CHANGELOG.md | 1 + src/widgets/BaseWindow.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c0f8762..498aec9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,7 @@ - Bugfix: Fixed Chatterino attempting to send empty messages (#3355) - Bugfix: Fixed IRC highlights not triggering sounds or alerts properly. (#3368) - Bugfix: Fixed IRC /kick command crashing if parameters were malformed. (#3382) +- Bugfix: Fixed a crash that could occur on certain Linux systems when toggling the Always on Top flag. (#3385) - Dev: Add GitHub action to test builds without precompiled headers enabled. (#3327) - Dev: Renamed CMake's build option `USE_SYSTEM_QT5KEYCHAIN` to `USE_SYSTEM_QTKEYCHAIN`. (#3103) - Dev: Add benchmarks that can be compiled with the `BUILD_BENCHMARKS` CMake flag. Off by default. (#3038) diff --git a/src/widgets/BaseWindow.cpp b/src/widgets/BaseWindow.cpp index bc966f33..f3ded0b1 100644 --- a/src/widgets/BaseWindow.cpp +++ b/src/widgets/BaseWindow.cpp @@ -238,8 +238,9 @@ void BaseWindow::init() { getSettings()->windowTopMost.connect( [this](bool topMost, auto) { + auto isVisible = this->isVisible(); this->setWindowFlag(Qt::WindowStaysOnTopHint, topMost); - if (this->isVisible()) + if (isVisible) { this->show(); }