aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-08-04 01:09:06 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-09-29 17:44:07 +0200
commit6d5cda4781afd18a49dacb588405bcd985364339 (patch)
tree23ab574e9e61dce1f931b385ae34619c473d45e2 /nx-X11/programs
parent25cbfd14f01bf2cdeb7504a5d8a3b03d924e243f (diff)
downloadnx-libs-6d5cda4781afd18a49dacb588405bcd985364339.tar.gz
nx-libs-6d5cda4781afd18a49dacb588405bcd985364339.tar.bz2
nx-libs-6d5cda4781afd18a49dacb588405bcd985364339.zip
Clipboard.c: improve TARGETS request handling
Diffstat (limited to 'nx-X11/programs')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Clipboard.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
index f5b163720..07a82b16c 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
@@ -599,15 +599,17 @@ FIXME: Do we need this?
if (X->xselectionrequest.target == serverTARGETS)
{
- Atom xa_STRING = XA_STRING;
+ Atom targets[] = {XA_STRING};
+ int numTargets = 1;
+
XChangeProperty (nxagentDisplay,
X->xselectionrequest.requestor,
X->xselectionrequest.property,
XInternAtom(nxagentDisplay, "ATOM", 0),
sizeof(Atom)*8,
PropModeReplace,
- (unsigned char*)&xa_STRING,
- 1);
+ (unsigned char*)&targets,
+ numTargets);
eventSelection.property = X->xselectionrequest.property;
}
else if (X->xselectionrequest.target == nxagentTimestampAtom)
@@ -1479,21 +1481,18 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
if (target == clientTARGETS)
{
- Atom xa_STRING[4];
-
/* --- Order changed by dimbor (prevent sending COMPOUND_TEXT to client --- */
- xa_STRING[0] = XA_STRING;
- xa_STRING[1] = clientUTF8_STRING;
- xa_STRING[2] = clientTEXT;
- xa_STRING[3] = clientCOMPOUND_TEXT;
+ Atom targets[] = {XA_STRING, clientUTF8_STRING, clientTEXT, clientCOMPOUND_TEXT};
+ int numTargets = 4;
ChangeWindowProperty(pWin,
property,
MakeAtom("ATOM", 4, 1),
sizeof(Atom)*8,
PropModeReplace,
- 4,
- &xa_STRING, 1);
+ numTargets,
+ &targets,
+ 1);
SendSelectionNotifyEventToClient(client, time, requestor, selection, target, property);