diff options
Diffstat (limited to 'xwayland/xwm.c')
-rw-r--r-- | xwayland/xwm.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 90b9cba8..2e859460 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -44,6 +44,13 @@ const char *atom_map[ATOM_LAST] = { "_NET_WM_STATE_MAXIMIZED_VERT", "_NET_WM_STATE_MAXIMIZED_HORZ", "WM_STATE", + "CLIPBOARD", + "_WL_SELECTION", + "TARGETS", + "CLIPBOARD_MANAGER", + "INCR", + "TEXT", + "TIMESTAMP", }; /* General helpers */ @@ -944,6 +951,11 @@ static int x11_event_handler(int fd, uint32_t mask, void *data) { break; } + if (xwm_handle_selection_event(xwm, event)) { + free(event); + continue; + } + switch (event->response_type & XCB_EVENT_RESPONSE_TYPE_MASK) { case XCB_CREATE_NOTIFY: xwm_handle_create_notify(xwm, (xcb_create_notify_event_t *)event); @@ -1115,15 +1127,12 @@ static void xwm_get_resources(struct wlr_xwm *xwm) { xcb_intern_atom(xwm->xcb_conn, 0, strlen(atom_map[i]), atom_map[i]); } for (i = 0; i < ATOM_LAST; i++) { - xcb_intern_atom_reply_t *reply; xcb_generic_error_t *error; - - reply = xcb_intern_atom_reply(xwm->xcb_conn, cookies[i], &error); - + xcb_intern_atom_reply_t *reply = + xcb_intern_atom_reply(xwm->xcb_conn, cookies[i], &error); if (reply && !error) { xwm->atoms[i] = reply->atom; } - free(reply); if (error) { @@ -1375,6 +1384,8 @@ struct wlr_xwm *xwm_create(struct wlr_xwayland *wlr_xwayland) { xwm_set_net_active_window(xwm, XCB_WINDOW_NONE); + xwm_selection_init(xwm); + xwm->compositor_surface_create.notify = handle_compositor_surface_create; wl_signal_add(&wlr_xwayland->compositor->events.create_surface, &xwm->compositor_surface_create); |