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
+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);
}
};