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.
This commit is contained in:
Tudor Brindus 2021-01-30 23:43:25 -05:00 committed by Simon Ser
parent 0977633457
commit 7964a313e8
5 changed files with 158 additions and 91 deletions

View file

@ -103,6 +103,8 @@ struct wlr_xwm {
xcb_render_pictformat_t render_format_id;
xcb_cursor_t cursor;
// FIXME: need one per selection to simultaneously request both mimetypes,
// I think.
xcb_window_t selection_window;
struct wlr_xwm_selection clipboard_selection;
struct wlr_xwm_selection primary_selection;