mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:48:12 +00:00
WindowServer: Begin refactoring towards a fully asynchronous protocol.
In order to move the WindowServer to userspace, I have to eliminate its dependence on system call facilities. The communication channel with each client needs to be message-based in both directions.
This commit is contained in:
parent
96352ab735
commit
4f98a35beb
18 changed files with 242 additions and 91 deletions
|
@ -5,11 +5,11 @@
|
|||
#include <AK/HashMap.h>
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <Kernel/GUITypes.h>
|
||||
|
||||
class GObject;
|
||||
class GNotifier;
|
||||
class GWindow;
|
||||
struct GUI_Event;
|
||||
|
||||
class GEventLoop {
|
||||
public:
|
||||
|
@ -34,15 +34,20 @@ public:
|
|||
|
||||
void exit(int);
|
||||
|
||||
bool post_message_to_server(const GUI_ClientMessage&);
|
||||
bool wait_for_specific_event(GUI_Event::Type, GUI_Event&);
|
||||
|
||||
GUI_Event sync_request(const GUI_ClientMessage& request, GUI_Event::Type response_type);
|
||||
|
||||
private:
|
||||
void wait_for_event();
|
||||
bool drain_events_from_server();
|
||||
void handle_paint_event(const GUI_Event&, GWindow&);
|
||||
void handle_mouse_event(const GUI_Event&, GWindow&);
|
||||
void handle_key_event(const GUI_Event&, GWindow&);
|
||||
void handle_window_activation_event(const GUI_Event&, GWindow&);
|
||||
void handle_window_close_request_event(const GUI_Event&, GWindow&);
|
||||
void handle_menu_event(const GUI_Event&);
|
||||
|
||||
void get_next_timer_expiration(timeval&);
|
||||
|
||||
struct QueuedEvent {
|
||||
|
@ -51,6 +56,8 @@ private:
|
|||
};
|
||||
Vector<QueuedEvent> m_queued_events;
|
||||
|
||||
Vector<GUI_Event> m_unprocessed_events;
|
||||
|
||||
int m_event_fd { -1 };
|
||||
bool m_running { false };
|
||||
bool m_exit_requested { false };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue