Implement per-client event masks

This allows multiple clients to listen for events on the same window.
Mostly used for listening events on the root window
This commit is contained in:
2026-02-23 00:25:27 +02:00
parent e376c57cda
commit 61f8b2fa66
3 changed files with 191 additions and 219 deletions

View File

@@ -68,7 +68,6 @@ struct Object
int32_t y { 0 };
int32_t cursor_x { -1 };
int32_t cursor_y { -1 };
uint32_t event_mask { 0 };
WINDOW parent;
CURSOR cursor;
CARD16 c_class;
@@ -78,6 +77,8 @@ struct Object
LibGUI::Texture
> window;
BAN::HashMap<Client*, uint32_t> event_masks;
BAN::HashMap<ATOM, Property> properties;
LibGUI::Texture& texture()
@@ -97,6 +98,9 @@ struct Object
return window.get<BAN::UniqPtr<LibGUI::Window>>()->texture();
ASSERT_NOT_REACHED();
}
uint32_t full_event_mask() const;
BAN::ErrorOr<void> send_event(xEvent event, uint32_t event_mask);
};
struct Pixmap