aboutsummaryrefslogtreecommitdiff
path: root/xwayland
diff options
context:
space:
mode:
Diffstat (limited to 'xwayland')
-rw-r--r--xwayland/selection/selection.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/xwayland/selection/selection.c b/xwayland/selection/selection.c
index 4cc8b627..0079df2f 100644
--- a/xwayland/selection/selection.c
+++ b/xwayland/selection/selection.c
@@ -34,9 +34,10 @@ void xwm_selection_transfer_destroy_property_reply(
void xwm_selection_transfer_init(struct wlr_xwm_selection_transfer *transfer,
struct wlr_xwm_selection *selection) {
- memset(transfer, 0, sizeof(*transfer));
- transfer->selection = selection;
- transfer->wl_client_fd = -1;
+ *transfer = (struct wlr_xwm_selection_transfer){
+ .selection = selection,
+ .wl_client_fd = -1,
+ };
}
void xwm_selection_transfer_destroy(
@@ -175,14 +176,14 @@ int xwm_handle_selection_event(struct wlr_xwm *xwm,
void xwm_selection_init(struct wlr_xwm_selection *selection,
struct wlr_xwm *xwm, xcb_atom_t atom) {
- memset(selection, 0, sizeof(*selection));
+ *selection = (struct wlr_xwm_selection){
+ .xwm = xwm,
+ .atom = atom,
+ .window = xcb_generate_id(xwm->xcb_conn),
+ };
wl_list_init(&selection->incoming);
wl_list_init(&selection->outgoing);
- selection->xwm = xwm;
- selection->atom = atom;
- selection->window = xcb_generate_id(xwm->xcb_conn);
-
if (atom == xwm->atoms[DND_SELECTION]) {
xcb_create_window(
xwm->xcb_conn,