Commit 68125b06 authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

Clipboard.c: Use Find*Index helpers at more locations

parent feedae86
......@@ -770,8 +770,9 @@ void nxagentRequestSelection(XEvent *X)
}
/* the selection in this request is none we own. */
if ((X->xselectionrequest.selection != lastSelectionOwner[nxagentPrimarySelection].selection) &&
(X->xselectionrequest.selection != lastSelectionOwner[nxagentClipboardSelection].selection))
{
int i = nxagentFindLastSelectionOwnerIndex(X->xselectionrequest.selection);
if (i == nxagentMaxSelections)
{
#ifdef DEBUG
fprintf(stderr, "%s: not owning selection [%ld] - denying request.\n", __func__, X->xselectionrequest.selection);
......@@ -780,6 +781,7 @@ void nxagentRequestSelection(XEvent *X)
nxagentReplyRequestSelection(X, False);
return;
}
}
/* this is a special request like TARGETS or TIMESTAMP */
if (!nxagentValidServerTargets(X->xselectionrequest.target))
......@@ -1724,17 +1726,14 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
return 0;
}
for (int i = 0; i < nxagentMaxSelections; i++)
{
if (selection == CurrentSelections[i].selection &&
IS_INTERNAL_OWNER(i))
int i = nxagentFindCurrentSelectionIndex(selection);
if (i < NumCurrentSelections && IS_INTERNAL_OWNER(i))
{
/*
* There is a client owner on the agent side, let normal dix stuff happen.
*/
return 0;
}
}
/*
* if lastClientWindowPtr is set we are waiting for an answer from
......
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