Robbendebiene / Gesturefy

Navigate, operate, and browse faster with mouse gestures! A customizable Firefox mouse gesture add-on with a variety of different commands.
https://addons.mozilla.org/firefox/addon/gesturefy/
GNU General Public License v3.0
829 stars 74 forks source link

Fast gestures on laggy sites are recognized improperly #636

Closed norill closed 2 years ago

norill commented 2 years ago

Describe your matter in detail

Performing a gesture very quickly on certain sites leads to a different gesture being fired. This usually happens when a heavy site is loading or sometimes even after the site is loaded (eg. https://devicehunt.com/all-usb-vendors ). No matter what gesture i perform, it's always recognized as a ~left~ down drag. It only happens if the gesture is performed with a single quick stroke. It occurs even if you hold the mouse button down for a long time after the initial stroke, as long as the cursor doesn't move - if it moves even one pixel then the correct gesture will fire.

Screenshots or further assistance

2022-04-09 00_49_46-All USB Vendors _ Device Hunt — Mozilla Firefox

Your System

Robbendebiene commented 2 years ago

As far as I know this cannot been solved. This is due to the (mostly) single threaded nature of JavaScript. Since the site is in use by other code or parsing HTML there is less room for dispatching any pointer events. Gesturefy is even using https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/getCoalescedEvents to get as much information about the mousemovement as possible.

No matter what gesture i perform, it's always recognized as a left drag.

If you perform a right swipe is it really always recognized as a left swipe? Can you make a screen recording of this (including your mouse cursor)? At least I cannot reproduce this and it also doesn't make sense to me. All I get is laggy gestures.

Just to be clear, does the visual gesture representation somehow match the executed gesture for you (even though you might have moved your mouse differently then visualized)?

norill commented 2 years ago

correction - gestures are always improperly recognized as down swipe, not left. sorry for the confusion. Visual gesture representation always matches the actual movement, although during a lag it degenerates to a single line segment that only matches start and end point dfgdfgd

norill commented 2 years ago

notice how the gesture name appears only if there are any follow-up movements after the initial stroke - by then the buggy condition disappears and the gesture is properly recognized. also a tip for reproducing: you can increase a site lagginess to arbitrary levels by repeated duplicating of the main div node in developer tools.

Robbendebiene commented 2 years ago

Thanks for the recording and additional explanation.

notice how the gesture name appears only if there are any follow-up movements after the initial stroke

So I think I was able to fix this.

However I was not able to reproduce the following part:

  • gestures are always improperly recognized as down swipe

Anyhow, can you please test the latest master branch?

norill commented 2 years ago

works perfectly, thanks!