mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +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
Notes:
sideshowbarker
2024-07-19 09:04:47 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/90c4e6b000d
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
Reference in a new issue