mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:48:11 +00:00
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.)
This commit is contained in:
parent
dcab11f5e9
commit
37d844fd66
9 changed files with 209 additions and 28 deletions
23
Ladybird/EventLoopPluginQt.h
Normal file
23
Ladybird/EventLoopPluginQt.h
Normal file
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue