[X2Go-Commits] [nx-libs] 20/28: Clipboard.c: use a TimeStamp datatype for lastTimeChanged as dix does

git-admin at x2go.org git-admin at x2go.org
Mon May 16 22:01:47 CEST 2022


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 7b22b2d40d2d5012d07059579ceeb9f0b8dcf041
Author: Ulrich Sibiller <uli42 at gmx.de>
Date:   Wed Nov 10 23:53:06 2021 +0100

    Clipboard.c: use a TimeStamp datatype for lastTimeChanged as dix does
    
    just to be consistent with dix.
---
 nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
index 2e47709f7..fe0267ab5 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
@@ -109,7 +109,7 @@ typedef struct _SelectionOwner
   ClientPtr  client;           /* local client */
   Window     window;           /* local window id */
   WindowPtr  windowPtr;        /* local window struct */
-  Time       lastTimeChanged;  /* local time (server time) */
+  TimeStamp  lastTimeChanged;  /* local time (server time) */
 } SelectionOwner;
 
 /*
@@ -373,7 +373,7 @@ static void printSelectionStat(int index)
     fprintf(stderr, "  lastSelectionOwner[].windowPtr         [%p] (-> [0x%x])\n", (void *)lOwner.windowPtr, WINDOWID(lOwner.windowPtr));
   else
     fprintf(stderr, "  lastSelectionOwner[].windowPtr         -\n");
-  fprintf(stderr, "  lastSelectionOwner[].lastTimeChanged   [%u]\n", lOwner.lastTimeChanged);
+  fprintf(stderr, "  lastSelectionOwner[].lastTimeChanged   [%u]\n", lOwner.lastTimeChanged.milliseconds);
 
   fprintf(stderr, "  CurrentSelections[].client             %s\n", nxagentClientInfoString(curSel.client));
   fprintf(stderr, "  CurrentSelections[].window             [0x%x]\n", curSel.window);
@@ -697,7 +697,7 @@ static void initSelectionOwnerData(int index)
   lastSelectionOwner[index].client = NullClient;
   lastSelectionOwner[index].window = screenInfo.screens[0]->root->drawable.id;
   lastSelectionOwner[index].windowPtr = NULL;
-  lastSelectionOwner[index].lastTimeChanged = GetTimeInMillis();
+  lastSelectionOwner[index].lastTimeChanged = ClientTimeToServerTime(CurrentTime);
 }
 
 /* there's no owner on nxagent side anymore */
@@ -706,7 +706,7 @@ static void clearSelectionOwnerData(int index)
   lastSelectionOwner[index].client = NullClient;
   lastSelectionOwner[index].window = None;
   lastSelectionOwner[index].windowPtr = NULL;
-  lastSelectionOwner[index].lastTimeChanged = GetTimeInMillis();
+  lastSelectionOwner[index].lastTimeChanged = ClientTimeToServerTime(CurrentTime);
 }
 
 static void storeSelectionOwnerData(int index, Selection *sel)
@@ -714,7 +714,7 @@ static void storeSelectionOwnerData(int index, Selection *sel)
   lastSelectionOwner[index].client = sel->client;
   lastSelectionOwner[index].window = sel->window;
   lastSelectionOwner[index].windowPtr = sel->pWin;
-  lastSelectionOwner[index].lastTimeChanged = GetTimeInMillis();
+  lastSelectionOwner[index].lastTimeChanged = ClientTimeToServerTime(CurrentTime);
 }
 
 static Bool matchSelectionOwner(int index, ClientPtr pClient, WindowPtr pWindow)
@@ -2394,16 +2394,7 @@ static void setSelectionOwnerOnXServer(Selection *pSelection)
   }
 
   #ifdef DEBUG
-  fprintf(stderr, "%s: lastSelectionOwner.client %s -> %s\n", __func__,
-              nxagentClientInfoString(lastSelectionOwner[index].client),
-                  nxagentClientInfoString(pSelection->client));
-  fprintf(stderr, "%s: lastSelectionOwner.window [0x%x] -> [0x%x]\n", __func__,
-              lastSelectionOwner[index].window, pSelection->window);
-  fprintf(stderr, "%s: lastSelectionOwner.windowPtr [%p] -> [%p] [0x%x] (serverWindow: [0x%lx])\n", __func__,
-              (void *)lastSelectionOwner[index].windowPtr, (void *)pSelection->pWin,
-                  pSelection->pWin ? nxagentWindow(pSelection->pWin) : 0, serverWindow);
-  fprintf(stderr, "%s: lastSelectionOwner.lastTimeChanged [%u]\n", __func__,
-              lastSelectionOwner[index].lastTimeChanged);
+  printSelectionStat(index);
   #endif
 
 

--
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