aboutsummaryrefslogtreecommitdiff
path: root/include/xwayland/selection.h
diff options
context:
space:
mode:
authorTudor Brindus <me@tbrindus.ca>2021-01-30 23:43:25 -0500
committerSimon Ser <contact@emersion.fr>2021-02-04 13:33:59 +0100
commit7964a313e8c59ed664235884d9b612273b12fc57 (patch)
treea29819715dd292e31eec2085b6af2c663ae2826a /include/xwayland/selection.h
parent09776334576ed5bd149ca553cb85e967f687b161 (diff)
xwayland/selection: use one X11 window per incoming transfer
This commit introduces logic for using a new X11 window for each incoming transfer, rather than having a global window for each selection source. This eliminates a whole class of bugs involving multiple concurrent incoming transfers. For now, we retain the outgoing transfer queue, and the selection source-specific windows to support it. Source-specific windows are no longer used in the incoming path, and will be removed in a future PR. Refs #1497.
Diffstat (limited to 'include/xwayland/selection.h')
-rw-r--r--include/xwayland/selection.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/include/xwayland/selection.h b/include/xwayland/selection.h
index 1d8d3ec4..07659cfd 100644
--- a/include/xwayland/selection.h
+++ b/include/xwayland/selection.h
@@ -20,37 +20,43 @@ struct wlr_xwm_selection_transfer {
struct wl_array source_data;
int wl_client_fd;
struct wl_event_source *event_source;
+ struct wl_list link;
// when sending to x11
xcb_selection_request_event_t request;
- struct wl_list outgoing_link;
// when receiving from x11
int property_start;
xcb_get_property_reply_t *property_reply;
+ xcb_window_t incoming_window;
};
struct wlr_xwm_selection {
struct wlr_xwm *xwm;
+
xcb_atom_t atom;
xcb_window_t window;
xcb_window_t owner;
xcb_timestamp_t timestamp;
- struct wlr_xwm_selection_transfer incoming;
+ struct wl_list incoming;
struct wl_list outgoing;
};
+struct wlr_xwm_selection_transfer *
+xwm_selection_find_incoming_transfer_by_window(
+ struct wlr_xwm_selection *selection, xcb_window_t window);
+
void xwm_selection_transfer_remove_event_source(
struct wlr_xwm_selection_transfer *transfer);
void xwm_selection_transfer_close_wl_client_fd(
struct wlr_xwm_selection_transfer *transfer);
void xwm_selection_transfer_destroy_property_reply(
struct wlr_xwm_selection_transfer *transfer);
-void xwm_selection_transfer_init(struct wlr_xwm_selection_transfer *transfer);
-void xwm_selection_transfer_finish(struct wlr_xwm_selection_transfer *transfer);
-bool xwm_selection_transfer_get_selection_property(
- struct wlr_xwm_selection_transfer *transfer, bool delete);
+void xwm_selection_transfer_init(struct wlr_xwm_selection_transfer *transfer,
+ struct wlr_xwm_selection *selection);
+void xwm_selection_transfer_destroy(
+ struct wlr_xwm_selection_transfer *transfer);
void xwm_selection_transfer_destroy_outgoing(
struct wlr_xwm_selection_transfer *transfer);