CotVNC normally goes nuts with scroll (mostly down) events when I scroll on my trackpad (two fingers, yay!). This filters away all those teensy scroll events that somehow fall on the wrong side of an if statement.
This is tested on an Intel Macbook 2.0Ghz, with trackpad and a logitech bluetooth mouse(+ wheel, naturally). The Client (Host? X has my head backwards) is a Debian box on Wired Gig ethernet, running XTightVnc, with KDE env. Played with scrolling in PAN(GTK) and Konqueror(KDE).
This is against CVS of July 15th, 07.
- (void)scrollWheel: (NSEvent *)theEvent
//printf("%s theEvent deltaX:%f Y:%f\n",__FILE__,[theEvent deltaX],[theEvent deltaY]);
if ( _viewOnly )
if ( fabs([theEvent deltaY]) <= 0.05 ) //trackpads can send lots of really small moves, my notchy mouseWheel gives 0.1 per move
NSPoint p = [_view convertPoint: [[_view window] convertScreenToBase: [NSEvent mouseLocation]]
if ( [theEvent deltaY] > 0.05 )
addMask = rfbButton4Mask;
else if ([theEvent deltaY] < -0.05 )
addMask = rfbButton5Mask;
else assert("An unknowable MouseWheel value!");
[_connection mouseAt: p buttons: _pressedButtons | addMask]; // 'Mouse button down'
[_connection mouseAt: p buttons: _pressedButtons]; // 'Mouse button up'