aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Tkac <atkac@redhat.com>2011-05-11 10:45:10 +0000
committerAdam Tkac <atkac@redhat.com>2011-05-11 10:45:10 +0000
commitc5fd1821f67f11458c9d7bdfd01483b16fe65720 (patch)
tree92993841b9f06403d9d1abde36ff55b870a41164
parentcfbbb5b5bcf0544bbe76f7c7a0cbce42d725f17b (diff)
downloadtigervnc-c5fd1821f67f11458c9d7bdfd01483b16fe65720.tar.gz
tigervnc-c5fd1821f67f11458c9d7bdfd01483b16fe65720.zip
[Bugfix] Fix 3-button mouse emulation in win viewer.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/branches/1_1@4405 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r--win/rfb_win32/CPointer.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/win/rfb_win32/CPointer.cxx b/win/rfb_win32/CPointer.cxx
index 03f8a386..eda6e388 100644
--- a/win/rfb_win32/CPointer.cxx
+++ b/win/rfb_win32/CPointer.cxx
@@ -54,7 +54,7 @@ void CPointer::pointerEvent(InputHandler* writer, const Point& pos, int buttonMa
}
-inline int _abs(int x) {return x>0 ? x : 0;}
+inline int _abs(int x) {return x>0 ? x : -x;}
int emulate3Mask(int buttonMask) {
// - Release left & right and press middle
@@ -102,7 +102,7 @@ void CPointer::threePointerEvent(InputHandler* writer, const Point& pos, int but
if (threeTimer.isActive()) {
// - We are timing for an emulation event
- if (_abs(threePos.x - pos.x) <= 4 || _abs(threePos.y - pos.y) <= 4) {
+ if (_abs(threePos.x - pos.x) > 4 || _abs(threePos.y - pos.y) > 4) {
// If the mouse has moved too far since the button-change event then flush
vlog.debug("emulate3: stop timer (moved)");
threeTimer.stop();