When xclip is used with Wayland compositor Weston, xclip loses selection ownership immediately and returns without waiting for SelectionRequest. Weston usually takes ownership before any X client on the server, due to which when xclip creates a window on the server and sets selection ownership together (b/c window creation request remains buffered until XGetSelectionOwner() ), the xclip receives SelectionClear immediately after it.
Debug log:
$ xclip -i -debug -sel clip <<< "hello"
xclip: debug: Debugging enabled.
Connected to X server.
Using selection: XA_CLIPBOARD
Using target: UTF8_STRING.
Waiting for selection requests, Control-C to quit
xclip: debug: Received SelectionClear event
Lost selection ownership. (window id 0x200001 did a copy).
xclip: debug: checking for requestors whose window has closed
Exiting.
When xclip is used with Wayland compositor Weston, xclip loses selection ownership immediately and returns without waiting for
SelectionRequest
. Weston usually takes ownership before any X client on the server, due to which when xclip creates a window on the server and sets selection ownership together (b/c window creation request remains buffered untilXGetSelectionOwner()
), the xclip receivesSelectionClear
immediately after it.Debug log:
Note: window id 0x200001 belongs to xwayland.
I have also tested the behaviour against master.
other reference issues: microsoft/terminal#11945