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
|
@ -10,7 +10,6 @@
|
|||
#include "Settings.h"
|
||||
#include "SettingsDialog.h"
|
||||
#include "WebView.h"
|
||||
#include <LibCore/EventLoop.h>
|
||||
#include <QAction>
|
||||
#include <QDialog>
|
||||
#include <QPlainTextEdit>
|
||||
|
@ -18,8 +17,7 @@
|
|||
extern String s_serenity_resource_root;
|
||||
extern Browser::Settings* s_settings;
|
||||
|
||||
BrowserWindow::BrowserWindow(Core::EventLoop& event_loop)
|
||||
: m_event_loop(event_loop)
|
||||
BrowserWindow::BrowserWindow()
|
||||
{
|
||||
m_tabs_container = new QTabWidget;
|
||||
m_tabs_container->setElideMode(Qt::TextElideMode::ElideRight);
|
||||
|
@ -257,13 +255,3 @@ void BrowserWindow::tab_favicon_changed(int index, QIcon icon)
|
|||
m_tabs_container->setTabIcon(index, icon);
|
||||
setWindowIcon(icon);
|
||||
}
|
||||
|
||||
void BrowserWindow::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
QWidget::closeEvent(event);
|
||||
|
||||
// FIXME: Ladybird only supports one window at the moment. When we support
|
||||
// multiple windows, we'll only want to fire off the quit event when
|
||||
// all of the browser windows have closed.
|
||||
m_event_loop.quit(0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue