diff --git a/CHANGELOG.md b/CHANGELOG.md index 11b6e492..a2c98640 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/src/messages/Image.cpp b/src/messages/Image.cpp index da91631d..ce636b5a 100644 --- a/src/messages/Image.cpp +++ b/src/messages/Image.cpp @@ -250,14 +250,19 @@ void assignFrames(std::weak_ptr weak, QList 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); } };