aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2020-10-12 20:12:28 +0200
committerUlrich Sibiller <uli42@gmx.de>2021-06-20 20:12:50 +0200
commitbf0e05fd166012b5fb38eb7533c27359b8d954f3 (patch)
treeba303100399ad2451d875ab5a136e9170e8ed13e
parent6753eb5928cf8a70317f0b1304bf4705309548ef (diff)
downloadnx-libs-bf0e05fd166012b5fb38eb7533c27359b8d954f3.tar.gz
nx-libs-bf0e05fd166012b5fb38eb7533c27359b8d954f3.tar.bz2
nx-libs-bf0e05fd166012b5fb38eb7533c27359b8d954f3.zip
Clipboard.c: restructure request accumulation code
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Clipboard.c39
1 files changed, 22 insertions, 17 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
index cd3a890d0..30b781590 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
@@ -2080,27 +2080,32 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
return 1;
}
- if (lastClients[index].clientPtr == client && (GetTimeInMillis() - lastClients[index].reqTime < ACCUM_TIME))
+ if (lastClients[index].clientPtr == client)
{
- /*
- * The same client made consecutive requests of clipboard content
- * with less than 5 seconds time interval between them.
- */
- #ifdef DEBUG
- fprintf(stderr, "%s: Consecutives request from client %s selection [%u] "
- "elapsed time [%u] clientAccum [%d]\n", __func__, nxagentClientInfoString(client),
- selection, GetTimeInMillis() - lastClients[index].reqTime, clientAccum);
- #endif
-
- clientAccum++;
+ if (GetTimeInMillis() - lastClients[index].reqTime < ACCUM_TIME)
+ {
+ /*
+ * The same client made consecutive requests of clipboard content
+ * with less than 5 seconds time interval between them.
+ */
+ #ifdef DEBUG
+ fprintf(stderr, "%s: Consecutives request from client %s selection [%u] "
+ "elapsed time [%u] clientAccum [%d]\n", __func__,
+ nxagentClientInfoString(client),
+ selection, GetTimeInMillis() - lastClients[index].reqTime,
+ clientAccum);
+ #endif
+
+ clientAccum++;
+ }
}
else
{
- /* reset clientAccum as now another client requested the clipboard content */
- if (lastClients[index].clientPtr != client)
- {
- clientAccum = 0;
- }
+ /*
+ * reset clientAccum as now another client requested the clipboard
+ * content
+ */
+ clientAccum = 0;
}
if (target == clientTEXT ||