From 96727d6e63ca927f3c7b68d4baa4fe672a4dcd0b Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Wed, 2 Apr 2025 20:49:49 +0530 Subject: Add events system for lua runtime to dispatch and register events --- src/widgets/BrowserApp.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/widgets/BrowserApp.cpp') diff --git a/src/widgets/BrowserApp.cpp b/src/widgets/BrowserApp.cpp index f2d541d..d65a122 100644 --- a/src/widgets/BrowserApp.cpp +++ b/src/widgets/BrowserApp.cpp @@ -11,8 +11,7 @@ BrowserApp::BrowserApp() { lua.start_event_loop(); // Router init - auto &router = WindowActionRouter::instance(); - router.initialize(); + WindowActionRouter::instance().initialize(); // Global event filter qApp->installEventFilter(this); @@ -22,14 +21,15 @@ BrowserApp::BrowserApp() { }; BrowserWindow *BrowserApp::create_window() { - auto *win = new BrowserWindow((const Configuration &)configuration); - win->setWindowTitle("null-browser"); - WindowActionRouter::instance().add_window(win); - win->show(); - return win; + auto *window = new BrowserWindow((const Configuration &)configuration); + window->setWindowTitle("null-browser"); + WindowActionRouter::instance().add_window(window); + window->show(); + return window; } bool BrowserApp::eventFilter(QObject *target, QEvent *event) { + // TODO: Prevent key release and shortcut on mode too if (event->type() != QEvent::KeyPress) return false; -- cgit v1.3.1