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
This commit is contained in:
pajlada 2021-12-05 13:38:21 +01:00 committed by GitHub
parent 2c695a9ac5
commit b41df18933
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -64,6 +64,7 @@
- Bugfix: Fixed Chatterino attempting to send empty messages (#3355) - Bugfix: Fixed Chatterino attempting to send empty messages (#3355)
- Bugfix: Fixed IRC highlights not triggering sounds or alerts properly. (#3368) - Bugfix: Fixed IRC highlights not triggering sounds or alerts properly. (#3368)
- Bugfix: Fixed IRC /kick command crashing if parameters were malformed. (#3382) - 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: 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: 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) - Dev: Add benchmarks that can be compiled with the `BUILD_BENCHMARKS` CMake flag. Off by default. (#3038)

View file

@ -238,8 +238,9 @@ void BaseWindow::init()
{ {
getSettings()->windowTopMost.connect( getSettings()->windowTopMost.connect(
[this](bool topMost, auto) { [this](bool topMost, auto) {
auto isVisible = this->isVisible();
this->setWindowFlag(Qt::WindowStaysOnTopHint, topMost); this->setWindowFlag(Qt::WindowStaysOnTopHint, topMost);
if (this->isVisible()) if (isVisible)
{ {
this->show(); this->show();
} }