From cfdec6b104f7db7a2cac2327925975cb187ee794 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 1 Nov 2010 12:04:11 +0100 Subject: vdagentd-x11: Work around a bug in xsel Although ICCCM 2.2. Responsibilities of the Selection Owner: http://tronche.com/gui/x/icccm/sec-2.html#s-2.2 Clearly states (about selection notify events): The owner should set the specified selection, target, time, and property arguments to the values received in the SelectionRequest event. xsel sets the selection notify event target member to the incr atom when it is going to send the clipboard data incremental, rather then setting it to the UTF8_STRING atom (which was the target of the SelectionRequest). Work around this (esp as it is likely other programs may get this wrong too) and accept the incr atom as a valid target in a selection notify event. --- vdagent-x11.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vdagent-x11.c b/vdagent-x11.c index 7c3acb8..47de448 100644 --- a/vdagent-x11.c +++ b/vdagent-x11.c @@ -586,7 +586,8 @@ static void vdagent_x11_handle_selection_notify(struct vdagent_x11 *x11, if (x11->clipboard_request_target == None) fprintf(x11->errfile, "SelectionNotify received without a target\n"); else if (!incr && - event->xselection.target != x11->clipboard_request_target) + event->xselection.target != x11->clipboard_request_target && + event->xselection.target != x11->incr_atom) fprintf(x11->errfile, "Requested %s target got %s\n", vdagent_x11_get_atom_name(x11, x11->clipboard_request_target), vdagent_x11_get_atom_name(x11, event->xselection.target)); -- cgit