From 21598c7e213d92d83417608a413f4ec34b4d5ef1 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Thu, 8 Aug 2019 21:44:15 +0200 Subject: Clipboard.c: fix: translate target on transfer --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'nx-X11') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 3ecb8f161..639fc293d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1927,6 +1927,29 @@ int nxagentSendNotify(xEvent *event) eventSelection.selection = lastSelectionOwner[nxagentClipboardSelection].selection; } + /* + * .target must be translated, too, as a client on the real + * server is requested to fill our property and it needs to know + * the format. + */ + + if (event->u.selectionNotify.target == clientUTF8_STRING) + { + eventSelection.target = serverUTF8_STRING; + } + else if (event->u.selectionNotify.target == clientTEXT) + { + eventSelection.target = serverTEXT; + } + /*else if (event->u.selectionNotify.target == clientCOMPOUND_TEXT) + { + eventSelection.target = serverCOMPOUND_TEXT; + }*/ + else + { + eventSelection.target = XA_STRING; + } + #ifdef DEBUG fprintf(stderr, "%s: mapping local to remote Atom: [%d] -> [%ld] [%s]\n", __func__, event->u.selectionNotify.selection, eventSelection.selection, -- cgit v1.2.3