fix: explicitly queue forced layouts (#6278)

This commit is contained in:
nerix
2025-06-17 09:48:44 +02:00
committed by GitHub
parent 3391826146
commit 09789378ca
2 changed files with 14 additions and 9 deletions
+1 -1
View File
@@ -45,7 +45,7 @@
- Dev: Removed authenticated PubSub implementation. (#6158)
- Dev: Save settings in `aboutToQuit`. (#6159)
- Dev: Bumped deprecation cutoff to Qt 6.4.3. (#6169)
- Dev: Use `QMetaObject::invokeMethod` to run code on a specific thread. (#6203)
- Dev: Use `QMetaObject::invokeMethod` to run code on a specific thread. (#6203, #6278)
- Dev: Added a `run-and-kill.sh` script to help debug crash-on-exit bugs. (#6188)
- Dev: Refactored the `TimeoutStackStyle` enum into its own file. (#6216)
- Dev: Refactored `Notebook`-related enums into their own file. (#6220)
+13 -8
View File
@@ -250,14 +250,19 @@ void assignFrames(std::weak_ptr<Image> weak, QList<Frame> parsed)
if (!isPushQueued)
{
isPushQueued = true;
postToThread([] {
isPushQueued = false;
auto *app = tryGetApp();
if (app != nullptr)
{
app->getWindows()->forceLayoutChannelViews();
}
});
// We don't use postToThread here, because that would run immediately.
// We explicitly want to queue a callback after the current ones.
QMetaObject::invokeMethod(
qApp,
[] {
isPushQueued = false;
auto *app = tryGetApp();
if (app != nullptr)
{
app->getWindows()->forceLayoutChannelViews();
}
},
Qt::QueuedConnection);
}
};