aboutsummaryrefslogtreecommitdiff
path: root/xwayland/xwm.c
diff options
context:
space:
mode:
Diffstat (limited to 'xwayland/xwm.c')
-rw-r--r--xwayland/xwm.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/xwayland/xwm.c b/xwayland/xwm.c
index a86fbd0e..a93f3525 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 */
@@ -168,6 +175,7 @@ void xwm_surface_activate(struct wlr_xwm *xwm,
xwm_send_focus_window(xwm, xsurface);
xwm->focus_surface = xsurface;
+ xwm_set_selection_owner(xwm);
xcb_flush(xwm->xcb_conn);
}
@@ -938,6 +946,12 @@ static int x11_event_handler(int fd, uint32_t mask, void *data) {
while ((event = xcb_poll_for_event(xwm->xcb_conn))) {
count++;
+
+ 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);
@@ -1360,6 +1374,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);