Nick, just following up from your initial response. I believe touchpad utilizes 
separate "touch" events, which are only registered once.

On a tangent, the wheel handling accumulates some pixels-per-event, which after 
hitting a threshold then triggers sending a wheel tick event. The exact values 
seem to have been derived through trial-and-error (they work fairly well). I've 
looked at a change however, that allows swapping between that behavior and just 
doing a one-to-one browser-event to guac-event. For mice this 1-1 behavior 
generally works better for my use cases, while the current 
accumulation/threshold behavior works better for touchpads (touchpads tend to 
generate many events). Is this something else that others would be interested 
in submitting upstream? I haven't brought this up before because I haven't seen 
anything on these mailing lists about it.

Christopher



> On Jul 11, 2024, at 7:41 AM, Nick Couchman <vn...@apache.org> wrote:
> 
> On Wed, Jul 10, 2024 at 2:29 PM Christopher Speck <die.drac...@gmail.com 
> <mailto:die.drac...@gmail.com>>
> wrote:
> 
>> Hi,
>> 
>> I've noticed that mouse wheel scroll events tend to result in excessive
>> scrolling. Has anyone else noticed similar behavior?
>> 
>> 
> Testing out quickly in my configuration, I'm not seeing this - but I'm
> using a touch pad, not an actual wheel, so not sure if that makes any
> difference.
> 
> 
>> Looking at guacamole-common-js/Mouse.js it looks like the wheel handler is
>> being attached in different ways to support old browsers, however modern
>> browsers support the old event names ("mousewheel" and "DOMMouseScroll")
>> for backwards compatibility in addition to the new ("wheel"). I think the
>> result is that Firefox (and likely Chrome) end up triggering the wheel
>> handler multiple times per actual use.
>> 
>> Should I create a JIRA issue for this? In basic testing a change like this
>> seems appropriate:
>> 
>> if (WheelEvent) {
>>  // all modern browsers
>>  addEventListener('wheel', ...
>> } else {
>>  // firefox
>>  addEventListener('DOMMouseScroll', ...
>>  // chrome
>>  addEventListener('mousewheel', ...
>> }
>> 
>> 
>> https://developer.mozilla.org/en-US/docs/Web/API/Element/DOMMouseScroll_event
>> https://developer.mozilla.org/en-US/docs/Web/API/Element/mousewheel_event
>> 
>> 
> Yes, seems like a Jira issue for this would be appropriate, and then a pull
> request. If the above code fixes it for you, then it probably is a bug that
> I'm just not seeing for one reason or another, so you can submit the PR
> against the "patch" branch and put it in as a bug fix.
> 
> Thanks!
> -Nick

Reply via email to