libui: Make App::process_events() private
Previously this was public as some applications (mainly terminal) needed to run some code in-between events, but this is no longer needed, due to the EventLoop providing these services (timers and file descriptor notifiers)
This commit is contained in:
parent
e4c9211edc
commit
cee677b1f7
@ -53,8 +53,6 @@ namespace ui
|
|||||||
|
|
||||||
Result<void> handle_ipc_event(u8 id);
|
Result<void> handle_ipc_event(u8 id);
|
||||||
|
|
||||||
bool process_events();
|
|
||||||
|
|
||||||
static App& the();
|
static App& the();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -65,6 +63,10 @@ namespace ui
|
|||||||
bool m_should_close { false };
|
bool m_should_close { false };
|
||||||
os::EventLoop m_loop;
|
os::EventLoop m_loop;
|
||||||
|
|
||||||
|
bool process_events();
|
||||||
|
|
||||||
Window* find_window(int id);
|
Window* find_window(int id);
|
||||||
|
|
||||||
|
friend void handle_socket_event(int, int);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -19,14 +19,14 @@ Result<void> handle_ipc_client_event(os::LocalClient&, u8 id)
|
|||||||
return ui::App::the().handle_ipc_event(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
|
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::s_app { nullptr };
|
||||||
|
|
||||||
App::App()
|
App::App()
|
||||||
|
Loading…
Reference in New Issue
Block a user