diff options
author | enikey <enikey@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2009-01-19 11:30:27 +0000 |
---|---|---|
committer | enikey <enikey@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2009-01-19 11:30:27 +0000 |
commit | 1abaff963c34d59d8c596e24d0b59dbd0103b8be (patch) | |
tree | 4a00bec224ee69ec539fbf3d1b30e4473f4a5d47 /java/src/com | |
parent | 7a83ad1f70016009982cba56f2a094f4937ec433 (diff) | |
download | tigervnc-1abaff963c34d59d8c596e24d0b59dbd0103b8be.tar.gz tigervnc-1abaff963c34d59d8c596e24d0b59dbd0103b8be.zip |
[Developement] Viewer can limit mouse events transfer (see mouseMaxFreq member).
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3559 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'java/src/com')
-rw-r--r-- | java/src/com/tightvnc/vncviewer/VncCanvas.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/java/src/com/tightvnc/vncviewer/VncCanvas.java b/java/src/com/tightvnc/vncviewer/VncCanvas.java index 59e22feb..56019be9 100644 --- a/java/src/com/tightvnc/vncviewer/VncCanvas.java +++ b/java/src/com/tightvnc/vncviewer/VncCanvas.java @@ -95,6 +95,10 @@ class VncCanvas extends Canvas // True if was no one auto resize of canvas boolean isFirstSizeAutoUpdate = true; + // Members for limiting sending mouse events to server + long lastMouseEventSendTime = System.currentTimeMillis(); + long mouseMaxFreq = 20; + // // The constructors. // @@ -813,7 +817,10 @@ class VncCanvas extends Canvas if (viewer.rfb != null && rfb.inNormalProtocol) { if (!inSelectionMode) { if (inputEnabled) { - sendMouseEvent(evt, moved); + if (System.currentTimeMillis() - lastMouseEventSendTime >= + (1000 / mouseMaxFreq)) { + sendMouseEvent(evt, moved); + } } } else { handleSelectionMouseEvent(evt); @@ -837,6 +844,7 @@ class VncCanvas extends Canvas e.printStackTrace(); } rfb.notify(); + lastMouseEventSendTime = System.currentTimeMillis(); } } |