Commit e34f152c authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

Clipboard.c: clientAccum is only used for debugging, add DEBUG ifdefs

parent 98a0810f
...@@ -68,7 +68,9 @@ extern Selection *CurrentSelections; ...@@ -68,7 +68,9 @@ extern Selection *CurrentSelections;
int nxagentLastClipboardClient = -1; int nxagentLastClipboardClient = -1;
static int agentClipboardStatus; static int agentClipboardStatus;
#ifdef DEBUG
static int clientAccum; static int clientAccum;
#endif
Atom serverCutProperty; Atom serverCutProperty;
Atom clientCutProperty; Atom clientCutProperty;
...@@ -1529,29 +1531,29 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, ...@@ -1529,29 +1531,29 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
} }
} }
#ifdef DEBUG
if (lastClientClientPtr == client && (GetTimeInMillis() - lastClientReqTime < 5000)) if (lastClientClientPtr == client && (GetTimeInMillis() - lastClientReqTime < 5000))
{ {
/* /*
* The same client made consecutive requests * The same client made consecutive requests of clipboard contents
* of clipboard contents with less than 5 * with less than 5 seconds time interval between them.
* seconds time interval between them.
*/ */
#ifdef DEBUG
fprintf(stderr, "%s: Consecutives request from client [%p] selection [%u] " fprintf(stderr, "%s: Consecutives request from client [%p] selection [%u] "
"elapsed time [%u] clientAccum [%d]\n", __func__, (void *) client, selection, "elapsed time [%u] clientAccum [%d]\n", __func__, (void *) client, selection,
GetTimeInMillis() - lastClientReqTime, clientAccum); GetTimeInMillis() - lastClientReqTime, clientAccum);
#endif
clientAccum++; clientAccum++;
} }
else else
{ {
/* reset clientAccum as now another client requested the clipboard content */
if (lastClientClientPtr != client) if (lastClientClientPtr != client)
{ {
clientAccum = 0; clientAccum = 0;
} }
} }
#endif
if ((target == clientTEXT) || if ((target == clientTEXT) ||
(target == XA_STRING) || (target == XA_STRING) ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment