xwayland: add a size-safe wrapper for xcb_send_event

xcb_send_event expects the caller to always provide 32 byte data, even if the actual event struct is
smaller than that.

Reference: https://gitlab.freedesktop.org/xorg/lib/libxcb/-/issues/18
This commit is contained in:
Ilia Bozhinov 2024-04-20 14:59:40 +02:00
parent cc10a5259d
commit c63275d75e
4 changed files with 35 additions and 8 deletions

View file

@ -162,4 +162,8 @@ char *xwm_get_atom_name(struct wlr_xwm *xwm, xcb_atom_t atom);
bool xwm_atoms_contains(struct wlr_xwm *xwm, xcb_atom_t *atoms,
size_t num_atoms, enum atom_name needle);
xcb_void_cookie_t xwm_send_event_with_size(xcb_connection_t *c,
uint8_t propagate, xcb_window_t destination,
uint32_t event_mask, const void *event, uint32_t length);
#endif