1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:57:43 +00:00

Ladybird: Trigger browser to quit when the main window is closed

This patch adds an event handler to the main window which allows it to
respond to a user closing the window. This event is then passed on to
the LibCore event loop, which allows the application quit itself.
Previously the application would hang, only running in the background,
until killed by an external force.
This commit is contained in:
Matthew Costa 2022-07-05 18:42:45 +01:00 committed by Andrew Kaster
parent 95e3e06a1e
commit 7bf3010185
3 changed files with 19 additions and 3 deletions

View file

@ -28,7 +28,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
Core::EventLoop event_loop;
QApplication app(arguments.argc, arguments.argv);
BrowserWindow window;
BrowserWindow window(event_loop);
window.setWindowTitle("Ladybird");
window.resize(800, 600);
window.show();