Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
166102e0
Commit
166102e0
authored
Nov 17, 2019
by
Ulrich Sibiller
Committed by
Mike Gabriel
Jan 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clipboard.c: use macros instead of hardcoced values for timeouts
parent
f05a2eca
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
Clipboard.c
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+14
-3
No files found.
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
View file @
166102e0
...
...
@@ -146,6 +146,17 @@ static char szAgentCOMPOUND_TEXT[] = "COMPOUND_TEXT";
static
char
szAgentUTF8_STRING
[]
=
"UTF8_STRING"
;
static
char
szAgentNX_CUT_BUFFER_CLIENT
[]
=
"NX_CUT_BUFFER_CLIENT"
;
/* number of milliseconds to wait for a conversion from the real X server. */
#define CONVERSION_TIMEOUT 5000
#ifdef DEBUG
/*
* Time window (milliseconds) within to detect multiple conversion
* calls of the same client.
*/
#define ACCUM_TIME 5000
#endif
/*
* some helpers for debugging output
*/
...
...
@@ -1698,7 +1709,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
fprintf
(
stderr
,
"%s: lastClientWindowPtr != NULL.
\n
"
,
__func__
);
#endif
if
((
GetTimeInMillis
()
-
lastClientReqTime
)
>=
5000
)
if
((
GetTimeInMillis
()
-
lastClientReqTime
)
>=
CONVERSION_TIMEOUT
)
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s: timeout expired on last request, "
...
...
@@ -1814,7 +1825,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
}
#ifdef DEBUG
if
(
lastClientClientPtr
==
client
&&
(
GetTimeInMillis
()
-
lastClientReqTime
<
5000
))
if
(
lastClientClientPtr
==
client
&&
(
GetTimeInMillis
()
-
lastClientReqTime
<
ACCUM_TIME
))
{
/*
* The same client made consecutive requests of clipboard content
...
...
@@ -1858,7 +1869,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
lastClientTarget
=
target
;
/* if the last client request time is more than 5s ago update it. Why? */
if
((
GetTimeInMillis
()
-
lastClientReqTime
)
>=
5000
)
if
((
GetTimeInMillis
()
-
lastClientReqTime
)
>=
CONVERSION_TIMEOUT
)
lastClientReqTime
=
GetTimeInMillis
();
if
(
selection
==
MakeAtom
(
"CLIPBOARD"
,
9
,
0
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment