commit 4c8c317633bef98e8f2d7b25476a25a64e62b951
parent 9674445d8ea9f60f4d1a154be6fdb12e7af8f0c6
Author: Eric Biggers <ebiggers3@gmail.com>
Date: Sun, 6 Mar 2016 11:45:59 -0600
Send correct SelectionNotify event when starting INCR transfer
The target should be copied from that given in SelectionRequest, not set
to INCR. This fixes a bug where it was impossible to paste > 4000
characters of text from xsel to the Chromium browser. Note that some
programs, including Chromium, validate the 'target' that is passed back;
while other programs, such as those which use the GTK clipboard API,
ignore it. But based the ICCCM, it appears that xsel is incorrect, not
chromium:
"The owner should set the specified selection, target, time, and
propety arguments to the values received in the SelectionRequest event."
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/xsel.c b/xsel.c
@@ -1299,13 +1299,13 @@ change_property (Display * display, Window requestor, Atom property,
print_debug (D_TRACE, "large data transfer");
- /* Send a SelectionNotify event of type INCR */
+ /* Send a SelectionNotify event */
ev.type = SelectionNotify;
ev.display = display;
ev.requestor = requestor;
ev.selection = selection;
ev.time = time;
- ev.target = incr_atom; /* INCR */
+ ev.target = target;
ev.property = property;
XSelectInput (ev.display, ev.requestor, PropertyChangeMask);