diff --git a/libui/include/ui/App.h b/libui/include/ui/App.h index 5f44683b..a20be946 100644 --- a/libui/include/ui/App.h +++ b/libui/include/ui/App.h @@ -53,8 +53,6 @@ namespace ui Result handle_ipc_event(u8 id); - bool process_events(); - static App& the(); private: @@ -65,6 +63,10 @@ namespace ui bool m_should_close { false }; os::EventLoop m_loop; + bool process_events(); + Window* find_window(int id); + + friend void handle_socket_event(int, int); }; } diff --git a/libui/src/App.cpp b/libui/src/App.cpp index fd3e9f3d..da3c9fd8 100644 --- a/libui/src/App.cpp +++ b/libui/src/App.cpp @@ -19,14 +19,14 @@ Result handle_ipc_client_event(os::LocalClient&, u8 id) return ui::App::the().handle_ipc_event(id); } -void handle_socket_event(int, int status) -{ - if (status & POLLHUP) ui::App::the().set_should_close(true); - if (status & POLLIN) { ui::App::the().process_events(); } -} - namespace ui { + void handle_socket_event(int, int status) + { + if (status & POLLHUP) ui::App::the().set_should_close(true); + if (status & POLLIN) { ui::App::the().process_events(); } + } + App* App::s_app { nullptr }; App::App()