aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-11-17 16:28:18 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-01-05 23:36:02 +0100
commit5540a14925a0145444bf11c507d53bbcf633508a (patch)
treebd075a72287af7a11d83e8d15e53bf93fad91ee9 /nx-X11/programs
parent1feb4985ebc5abb20bcd59ace1ee190c9cddbaac (diff)
downloadnx-libs-5540a14925a0145444bf11c507d53bbcf633508a.tar.gz
nx-libs-5540a14925a0145444bf11c507d53bbcf633508a.tar.bz2
nx-libs-5540a14925a0145444bf11c507d53bbcf633508a.zip
Clipboard.c: add nxagentMatchSelectionOwner helper function
Diffstat (limited to 'nx-X11/programs')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Clipboard.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
index 8fd6dc7bb..52f06f47d 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
@@ -519,6 +519,12 @@ void nxagentStoreSelectionOwner(int index, Selection *sel)
lastSelectionOwner[index].lastTimeChanged = GetTimeInMillis();
}
+Bool nxagentMatchSelectionOwner(int index, ClientPtr pClient, WindowPtr pWindow)
+{
+ return ((pClient && lastSelectionOwner[index].client == pClient) ||
+ (pWindow && lastSelectionOwner[index].windowPtr == pWindow));
+}
+
void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow)
{
#ifdef DEBUG
@@ -534,8 +540,7 @@ void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow)
for (int i = 0; i < nxagentMaxSelections; i++)
{
- if ((pClient != NULL && lastSelectionOwner[i].client == pClient) ||
- (pWindow != NULL && lastSelectionOwner[i].windowPtr == pWindow))
+ if (nxagentMatchSelectionOwner(i, pClient, pWindow))
{
#ifdef TEST
fprintf(stderr, "%s: Resetting state with client [%p] window [%p].\n", __func__,