aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-11-15 22:58:14 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-11-15 22:58:14 +0100
commita040e73ab4b4f66b61549edb66ee2cec374ea2cd (patch)
treee916a09ad7da36a597fcb1d2697165634033feff
parent6f5e483cd528f305d8e03e0672d3a1bccd75a004 (diff)
parentcfaf59728f0ff6ed5fe13f2093c89680943fa469 (diff)
downloadnx-libs-a040e73ab4b4f66b61549edb66ee2cec374ea2cd.tar.gz
nx-libs-a040e73ab4b4f66b61549edb66ee2cec374ea2cd.tar.bz2
nx-libs-a040e73ab4b4f66b61549edb66ee2cec374ea2cd.zip
Merge branch 'uli42-pr/utf8_clipboard' into 3.6.x
Attributes GH PR #875: https://github.com/ArcticaProject/nx-libs/pull/875
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Clipboard.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
index 5f7bdab4e..6ec30a3fb 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
@@ -716,23 +716,28 @@ void nxagentRequestSelection(XEvent *X)
* The selection does not matter here, we will return this for
* PRIMARY and CLIPBOARD.
*
- * FIXME: shouldn't we support UTF8_STRING, too?
* FIXME: I am wondering if we should align this with
* nxagentConvertSelection, where we report more formats.
* FIXME: the perfect solution should not just answer with
* XA_STRING but ask the real owner what format it supports. The
* should then be sent to the original requestor.
- * FIXME: these must be external Atoms!
+ * FIXME: add serverCOMPOUND_TEXT?
*/
- Atom targets[] = {XA_STRING};
- int numTargets = 1;
+ long targets[] = {XA_STRING, serverUTF8_STRING, serverTEXT, serverTARGETS, serverTIMESTAMP};
+ int numTargets = sizeof(targets) / sizeof(targets[0]);
#ifdef DEBUG
- fprintf(stderr, "%s: available targets:\n", __func__);
- for (int i = 0; i < numTargets; i++)
- fprintf(stderr, "%s: %s\n", __func__, NameForAtom(targets[i]));
- fprintf(stderr, "\n");
+ {
+ fprintf(stderr, "%s: Sending %d available targets:\n", __func__, numTargets);
+ for (int i = 0; i < numTargets; i++)
+ {
+ char *s = XGetAtomName(nxagentDisplay, targets[i]);
+ fprintf(stderr, "%s: %ld %s\n", __func__, targets[i], s);
+ SAFE_XFree(s);
+ }
+ fprintf(stderr, "\n");
+ }
#endif
/*
@@ -743,7 +748,7 @@ void nxagentRequestSelection(XEvent *X)
X->xselectionrequest.requestor,
X->xselectionrequest.property,
XInternAtom(nxagentDisplay, "ATOM", 0),
- sizeof(Atom)*8,
+ 32,
PropModeReplace,
(unsigned char*)&targets,
numTargets);
@@ -1702,7 +1707,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
{
/* --- Order changed by dimbor (prevent sending COMPOUND_TEXT to client --- */
Atom targets[] = {XA_STRING, clientUTF8_STRING, clientTEXT, clientCOMPOUND_TEXT};
- int numTargets = 4;
+ int numTargets = sizeof(targets) / sizeof(targets[0]);
#ifdef DEBUG
fprintf(stderr, "%s: available targets:\n", __func__);