aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-11-22 21:15:54 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-01-05 23:36:02 +0100
commit68125b06e852c96d60c1ee704f1700de8aa6c629 (patch)
tree8af9c4a3bc667ffe86348e96d129bc58aded118d /nx-X11/programs/Xserver/hw/nxagent
parentfeedae86bfa5601ed591efce9e97ddb4e463ca93 (diff)
downloadnx-libs-68125b06e852c96d60c1ee704f1700de8aa6c629.tar.gz
nx-libs-68125b06e852c96d60c1ee704f1700de8aa6c629.tar.bz2
nx-libs-68125b06e852c96d60c1ee704f1700de8aa6c629.zip
Clipboard.c: Use Find*Index helpers at more locations
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Clipboard.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
index 0709954b9..715895cf0 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
@@ -770,15 +770,17 @@ 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))
{
- #ifdef DEBUG
- fprintf(stderr, "%s: not owning selection [%ld] - denying request.\n", __func__, X->xselectionrequest.selection);
- #endif
+ 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);
+ #endif
- nxagentReplyRequestSelection(X, False);
- return;
+ nxagentReplyRequestSelection(X, False);
+ return;
+ }
}
/* this is a special request like TARGETS or TIMESTAMP */
@@ -1724,16 +1726,13 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
return 0;
}
- for (int i = 0; i < nxagentMaxSelections; i++)
+ int i = nxagentFindCurrentSelectionIndex(selection);
+ if (i < NumCurrentSelections && IS_INTERNAL_OWNER(i))
{
- if (selection == CurrentSelections[i].selection &&
- IS_INTERNAL_OWNER(i))
- {
- /*
- * There is a client owner on the agent side, let normal dix stuff happen.
- */
- return 0;
- }
+ /*
+ * There is a client owner on the agent side, let normal dix stuff happen.
+ */
+ return 0;
}
/*