From 6162e78c7f5f04078433362bb39cb774d15ff97f Mon Sep 17 00:00:00 2001 From: sin-ack Date: Sun, 25 Jul 2021 21:02:51 +0000 Subject: [PATCH] LibGUI: Let GUI applications create an inspectable EventLoop GUI applications automatically have EventLoops created for them via GUI::Application; however before this commit it was not possible to make the application event loop inspectable. This exposes a third optional argument to GUI::Application which allows one to make the application event loop inspectable. --- Userland/Libraries/LibGUI/Application.cpp | 4 ++-- Userland/Libraries/LibGUI/Application.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibGUI/Application.cpp b/Userland/Libraries/LibGUI/Application.cpp index 9a36856f3b..f9a1c9e3d6 100644 --- a/Userland/Libraries/LibGUI/Application.cpp +++ b/Userland/Libraries/LibGUI/Application.cpp @@ -68,11 +68,11 @@ Application* Application::the() return *s_the; } -Application::Application(int argc, char** argv) +Application::Application(int argc, char** argv, Core::EventLoop::MakeInspectable make_inspectable) { VERIFY(!*s_the); *s_the = *this; - m_event_loop = make(); + m_event_loop = make(make_inspectable); WindowServerConnection::the(); Clipboard::initialize({}); if (argc > 0) diff --git a/Userland/Libraries/LibGUI/Application.h b/Userland/Libraries/LibGUI/Application.h index 2b8b12a9fc..09a073a20c 100644 --- a/Userland/Libraries/LibGUI/Application.h +++ b/Userland/Libraries/LibGUI/Application.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -79,7 +80,7 @@ public: Function on_action_leave; private: - Application(int argc, char** argv); + Application(int argc, char** argv, Core::EventLoop::MakeInspectable = Core::EventLoop::MakeInspectable::No); virtual void event(Core::Event&) override;