diff options
author | Andreas Kling <kling@serenityos.org> | 2022-09-07 20:33:15 +0200 |
---|---|---|
committer | Andrew Kaster <andrewdkaster@gmail.com> | 2022-12-25 07:58:58 -0700 |
commit | 37d844fd664d7d22ac9626ff3d566a4ec52d857c (patch) | |
tree | e4fc2861797deff335ba94fc527a6ad349d293e3 /Ladybird/EventLoopPluginQt.h | |
parent | dcab11f5e9acf76dc00421db5934d43e5c1cc823 (diff) | |
download | serenity-37d844fd664d7d22ac9626ff3d566a4ec52d857c.zip |
Ladybird: Use only the Qt event loop to speed everything up :^)
This patch removes the dual-event-loop setup, leaving only the Qt event
loop. We teach LibWeb how to drive Qt by installing an EventLoopPlugin.
This removes the 50ms latency on all UI interactions (and network
requests, etc.)
Diffstat (limited to 'Ladybird/EventLoopPluginQt.h')
-rw-r--r-- | Ladybird/EventLoopPluginQt.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Ladybird/EventLoopPluginQt.h b/Ladybird/EventLoopPluginQt.h new file mode 100644 index 0000000000..f094ffcb6b --- /dev/null +++ b/Ladybird/EventLoopPluginQt.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2022, Andreas Kling <kling@serenityos.org> + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include <LibWeb/Platform/EventLoopPlugin.h> + +namespace Ladybird { + +class EventLoopPluginQt final : public Web::Platform::EventLoopPlugin { +public: + EventLoopPluginQt(); + virtual ~EventLoopPluginQt() override; + + virtual void spin_until(Function<bool()> goal_condition) override; + virtual void deferred_invoke(Function<void()>) override; + virtual NonnullRefPtr<Web::Platform::Timer> create_timer() override; +}; + +} |