From 5d1577abed04e7ea413616232248c7058f960492 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Mon, 18 Nov 2019 07:38:16 +0100 Subject: Clipboard.c: reorder nxagentInitClipboard It makes sense to measure time and set the initialized flag right at the start. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'nx-X11') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index e77984472..44948859d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -2127,6 +2127,16 @@ Bool nxagentInitClipboard(WindowPtr pWin) fprintf(stderr, "%s: Got called.\n", __func__); #endif + #ifdef NXAGENT_TIMESTAMP + { + fprintf(stderr, "%s: Clipboard init starts at [%ld] ms.\n", __func__, + GetTimeInMillis() - startTime); + } + #endif + + agentClipboardInitialized = False; + serverWindow = nxagentWindow(pWin); + if (!nxagentReconnectTrap) { SAFE_free(lastSelectionOwner); @@ -2147,15 +2157,6 @@ Bool nxagentInitClipboard(WindowPtr pWin) lastSelectionOwner[nxagentClipboardSelection].selection = nxagentAtoms[10]; /* CLIPBOARD */ } - #ifdef NXAGENT_TIMESTAMP - { - fprintf(stderr, "%s: Initializing start [%ld] milliseconds.\n", __func__, - GetTimeInMillis() - startTime); - } - #endif - - agentClipboardInitialized = False; - serverWindow = nxagentWindow(pWin); serverTARGETS = nxagentAtoms[6]; /* TARGETS */ serverTEXT = nxagentAtoms[7]; /* TEXT */ @@ -2294,7 +2295,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) #ifdef NXAGENT_TIMESTAMP { - fprintf(stderr, "%s: initializing ends [%ld] milliseconds.\n", __func__, + fprintf(stderr, "%s: Clipboard init ends at [%ld] ms.\n", __func__, GetTimeInMillis() - startTime); } #endif -- cgit v1.2.3