[X2Go-Commits] [nx-libs] 335/429: Clipboard.c: restructure request accumulation code

git-admin at x2go.org git-admin at x2go.org
Mon Oct 18 09:37:00 CEST 2021


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x
in repository nx-libs.

commit bf0e05fd166012b5fb38eb7533c27359b8d954f3
Author: Ulrich Sibiller <uli42 at gmx.de>
Date:   Mon Oct 12 20:12:28 2020 +0200

    Clipboard.c: restructure request accumulation code
---
 nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 39 +++++++++++++++-----------
 1 file 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 ||

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list