fix: ignore save requests after closing all windows (#5081)

This commit is contained in:
nerix 2024-01-14 13:37:03 +01:00 committed by GitHub
parent 13ff11ea75
commit 292f9b9734
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View file

@ -65,6 +65,7 @@
- Bugfix: Fixed avatar in usercard and moderation button triggering when releasing the mouse outside their area. (#5052)
- Bugfix: Fixed moderator-only topics being subscribed to for non-moderators. (#5056)
- Bugfix: Fixed a bug where buttons would remain in a hovered state after leaving them. (#5077)
- Bugfix: Fixed popup windows not persisting between restarts. (#5081)
- Bugfix: Fixed splits not retaining their focus after minimizing. (#5080)
- Dev: Run miniaudio in a separate thread, and simplify it to not manage the device ourselves. There's a chance the simplification is a bad idea. (#4978)
- Dev: Change clang-format from v14 to v16. (#4929)

View file

@ -421,7 +421,14 @@ void WindowManager::save()
{
return;
}
qCDebug(chatterinoWindowmanager) << "[WindowManager] Saving";
if (this->shuttingDown_)
{
qCDebug(chatterinoWindowmanager) << "Skipping save (shutting down)";
return;
}
qCDebug(chatterinoWindowmanager) << "Saving";
assertInGuiThread();
QJsonDocument document;
@ -700,6 +707,9 @@ void WindowManager::closeAll()
{
assertInGuiThread();
qCDebug(chatterinoWindowmanager) << "Shutting down (closing windows)";
this->shuttingDown_ = true;
for (Window *window : windows_)
{
window->close();

View file

@ -140,6 +140,7 @@ private:
const QString windowLayoutFilePath;
bool initialized_ = false;
bool shuttingDown_ = false;
QPoint emotePopupPos_;