mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:47:36 +00:00
LibThread: Post the completion callbacks to the *current* event loop
FilePicker was not showing thumbnails correctly because once each thumbnail rendering BackgroundAction completed, it posted a deferred invocation event to the *main* event loop. Since FilePicker runs in a nested event loop, those completion callbacks never ran until it was too late and the FilePicker was gone.
This commit is contained in:
parent
2ad405c789
commit
90c4e6b000
1 changed files with 2 additions and 2 deletions
|
@ -79,11 +79,11 @@ private:
|
|||
all_actions().resource().enqueue([this] {
|
||||
m_result = m_action();
|
||||
if (m_on_complete) {
|
||||
Core::EventLoop::main().post_event(*this, make<Core::DeferredInvocationEvent>([this](auto&) {
|
||||
Core::EventLoop::current().post_event(*this, make<Core::DeferredInvocationEvent>([this](auto&) {
|
||||
m_on_complete(m_result.release_value());
|
||||
this->unref();
|
||||
}));
|
||||
Core::EventLoop::main().wake();
|
||||
Core::EventLoop::wake();
|
||||
} else
|
||||
this->unref();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue