Bug Tracker item #3252506, was opened at 2011-03-28 12:07
Message generated for change (Comment added) made by jtuc
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1126848&aid=3252506&group_id=254363

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Windows version
Group: trunk
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Jochen Tucht (jtuc)
Assigned to: Peter Åstrand (astrand)
Summary: Odd code in 3-Button Mouse Emulation

Initial Comment:
win/rfb_win32/CPointer.cxx
@@ -57 +57 @@
-inline int _abs(int x) {return x>0 ? x : 0;}
+inline int _abs(int x) { return x > 0 ? x : -x; }
@@ -105 +105 @@
-        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) {


----------------------------------------------------------------------

>Comment By: Jochen Tucht (jtuc)
Date: 2011-05-10 17:46

Message:
My understanding of the code is that the if-block cancels emulate3, whereas
the else-block leaves it active.

----------------------------------------------------------------------

Comment By: Adam Tkac (atkac)
Date: 2011-05-03 11:59

Message:
The first part of the patch (_abs) seems fine for me.

However I think second part should be:
- 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) {

shouldn't it?

If mouse pointer doesn't move more than 4 points from its original
position (in both X and Y directions), then consider this as "emulate3
press". Otherwise (pointer moved more than 4 points in X or Y or both
directions), don't consider this as "emulate3 press".

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1126848&aid=3252506&group_id=254363

------------------------------------------------------------------------------
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-devel mailing list
Tigervnc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tigervnc-devel

Reply via email to