From 7b22b2d40d2d5012d07059579ceeb9f0b8dcf041 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 10 Nov 2021 23:53:06 +0100 Subject: 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 -- cgit v1.2.3