Revision: 4404
          http://tigervnc.svn.sourceforge.net/tigervnc/?rev=4404&view=rev
Author:   atkac
Date:     2011-05-11 10:44:09 +0000 (Wed, 11 May 2011)

Log Message:
-----------
[Bugfix] Fix 3-button mouse emulation in win viewer.

Modified Paths:
--------------
    trunk/win/rfb_win32/CPointer.cxx

Modified: trunk/win/rfb_win32/CPointer.cxx
===================================================================
--- trunk/win/rfb_win32/CPointer.cxx    2011-05-11 10:34:53 UTC (rev 4403)
+++ trunk/win/rfb_win32/CPointer.cxx    2011-05-11 10:44:09 UTC (rev 4404)
@@ -54,7 +54,7 @@
 }
 
 
-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 @@
       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();


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Tigervnc-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tigervnc-commits

Reply via email to