Commit 4d139d59 authored by dimbor's avatar dimbor

nxagent client-mode: fix clipboard problem (eterbug #4332) by Danil Pleshakov

parent 4d3fb73f
......@@ -708,46 +708,18 @@ void nxagentRequestSelection(XEvent *X)
{
if (X->xselectionrequest.target == serverTARGETS)
{
/*
* the selection request target is TARGETS. The requestor is
* asking for a list of supported data formats. Currently
* there's only one format we support: XA_STRING
*
* 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!
*/
Atom targets[] = {XA_STRING};
int numTargets = 1;
#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");
#endif
/*
* pass on the requested list by setting the property provided
* by the requestor accordingly.
*/
XChangeProperty(nxagentDisplay,
Atom xa_STRING[3];
xa_STRING[0] = XA_STRING;
xa_STRING[1] = serverUTF8_STRING;
xa_STRING[2] = serverTEXT;
XChangeProperty (nxagentDisplay,
X->xselectionrequest.requestor,
X->xselectionrequest.property,
XInternAtom(nxagentDisplay, "ATOM", 0),
sizeof(Atom)*8,
PropModeReplace,
(unsigned char*)&targets,
numTargets);
(unsigned char*)xa_STRING,
3);
nxagentReplyRequestSelection(X, True);
}
else if (X->xselectionrequest.target == serverTIMESTAMP)
......
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