|
|
@ -466,7 +466,6 @@ static int xwm_handle_xfixes_selection_notify(struct wlr_xwm *xwm,
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int xwm_handle_selection_event(struct wlr_xwm *xwm,
|
|
|
|
int xwm_handle_selection_event(struct wlr_xwm *xwm,
|
|
|
|
xcb_generic_event_t *event) {
|
|
|
|
xcb_generic_event_t *event) {
|
|
|
|
if (!xwm->seat) {
|
|
|
|
if (!xwm->seat) {
|
|
|
@ -542,13 +541,25 @@ static void handle_seat_set_selection(struct wl_listener *listener,
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (source->send == data_source_send)
|
|
|
|
if (source->send == data_source_send) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
xcb_set_selection_owner(xwm->xcb_conn,
|
|
|
|
xwm_set_selection_owner(xwm);
|
|
|
|
xwm->selection_window,
|
|
|
|
}
|
|
|
|
xwm->atoms[CLIPBOARD],
|
|
|
|
|
|
|
|
XCB_TIME_CURRENT_TIME);
|
|
|
|
void xwm_set_selection_owner(struct wlr_xwm *xwm) {
|
|
|
|
|
|
|
|
if (xwm->focus_surface && xwm->seat->selection_source) {
|
|
|
|
|
|
|
|
xcb_set_selection_owner(xwm->xcb_conn,
|
|
|
|
|
|
|
|
xwm->selection_window,
|
|
|
|
|
|
|
|
xwm->atoms[CLIPBOARD],
|
|
|
|
|
|
|
|
XCB_TIME_CURRENT_TIME);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
xcb_set_selection_owner(xwm->xcb_conn,
|
|
|
|
|
|
|
|
XCB_ATOM_NONE,
|
|
|
|
|
|
|
|
xwm->atoms[CLIPBOARD],
|
|
|
|
|
|
|
|
xwm->selection_timestamp);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void xwm_set_seat(struct wlr_xwm *xwm, struct wlr_seat *seat) {
|
|
|
|
void xwm_set_seat(struct wlr_xwm *xwm, struct wlr_seat *seat) {
|
|
|
|