aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-10-18 09:28:50 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-10-18 09:28:50 +0200
commitb7034724abb859db36a3fa4312e4827141114f45 (patch)
tree5e4406bd491e61be781de5b2075dabd76ba9514b /nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
parentb67b910a6adf3287fad10cc97cf9484b0057b0bd (diff)
parent31057d00b8cdbe97837f508c3cb0f2c521a30266 (diff)
downloadnx-libs-b7034724abb859db36a3fa4312e4827141114f45.tar.gz
nx-libs-b7034724abb859db36a3fa4312e4827141114f45.tar.bz2
nx-libs-b7034724abb859db36a3fa4312e4827141114f45.zip
Merge branch 'uli42-pr/many_clipboard_fixes' into 3.6.x
Attributes GH PR #1018: https://github.com/ArcticaProject/nx-libs/pull/1018
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
index a8739fa3f..5df008bbb 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
@@ -722,8 +722,8 @@ ProcConvertSelection(register ClientPtr client)
(stuff->selection == MakeAtom("CLIPBOARD", 9, 0))) &&
nxagentOption(Clipboard) != ClipboardNone)
{
- int i = nxagentFindCurrentSelectionIndex(stuff->selection);
- if ((i < NumCurrentSelections) && (CurrentSelections[i].window != None))
+ int index = nxagentFindCurrentSelectionIndex(stuff->selection);
+ if ((index != -1) && (CurrentSelections[index].window != None))
{
if (nxagentConvertSelection(client, pWin, stuff->selection, stuff->requestor,
stuff->property, stuff->target, stuff->time))
@@ -745,10 +745,15 @@ ProcConvertSelection(register ClientPtr client)
while ((i < NumCurrentSelections) &&
CurrentSelections[i].selection != stuff->selection) i++;
if ((i < NumCurrentSelections) &&
-#ifdef NXAGENT_SERVER
- (CurrentSelections[i].window != None) && (CurrentSelections[i].client != NullClient)
-#else
(CurrentSelections[i].window != None)
+#ifdef NXAGENT_SERVER
+ /*
+ * .window can be set and pointing to our server window to
+ * signal the clipboard owner being on the real X
+ * server. Therefore we need to check .client in addition
+ * to ensure having a local owner.
+ */
+ && (CurrentSelections[i].client != NullClient)
#endif
#ifdef XCSECURITY
&& (!client->CheckAccess ||