Commit 6d5cda47 authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

Clipboard.c: improve TARGETS request handling

parent 25cbfd14
...@@ -599,15 +599,17 @@ FIXME: Do we need this? ...@@ -599,15 +599,17 @@ FIXME: Do we need this?
if (X->xselectionrequest.target == serverTARGETS) if (X->xselectionrequest.target == serverTARGETS)
{ {
Atom xa_STRING = XA_STRING; Atom targets[] = {XA_STRING};
int numTargets = 1;
XChangeProperty (nxagentDisplay, XChangeProperty (nxagentDisplay,
X->xselectionrequest.requestor, X->xselectionrequest.requestor,
X->xselectionrequest.property, X->xselectionrequest.property,
XInternAtom(nxagentDisplay, "ATOM", 0), XInternAtom(nxagentDisplay, "ATOM", 0),
sizeof(Atom)*8, sizeof(Atom)*8,
PropModeReplace, PropModeReplace,
(unsigned char*)&xa_STRING, (unsigned char*)&targets,
1); numTargets);
eventSelection.property = X->xselectionrequest.property; eventSelection.property = X->xselectionrequest.property;
} }
else if (X->xselectionrequest.target == nxagentTimestampAtom) else if (X->xselectionrequest.target == nxagentTimestampAtom)
...@@ -1479,21 +1481,18 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, ...@@ -1479,21 +1481,18 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
if (target == clientTARGETS) if (target == clientTARGETS)
{ {
Atom xa_STRING[4];
/* --- Order changed by dimbor (prevent sending COMPOUND_TEXT to client --- */ /* --- Order changed by dimbor (prevent sending COMPOUND_TEXT to client --- */
xa_STRING[0] = XA_STRING; Atom targets[] = {XA_STRING, clientUTF8_STRING, clientTEXT, clientCOMPOUND_TEXT};
xa_STRING[1] = clientUTF8_STRING; int numTargets = 4;
xa_STRING[2] = clientTEXT;
xa_STRING[3] = clientCOMPOUND_TEXT;
ChangeWindowProperty(pWin, ChangeWindowProperty(pWin,
property, property,
MakeAtom("ATOM", 4, 1), MakeAtom("ATOM", 4, 1),
sizeof(Atom)*8, sizeof(Atom)*8,
PropModeReplace, PropModeReplace,
4, numTargets,
&xa_STRING, 1); &targets,
1);
SendSelectionNotifyEventToClient(client, time, requestor, selection, target, property); SendSelectionNotifyEventToClient(client, time, requestor, selection, target, property);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment