| Summary: | Suppress emulated mouse wheel scroll events on devices that support touch | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Alexander Nyßen <nyssen> |
| Component: | GEF FX | Assignee: | Alexander Nyßen <nyssen> |
| Status: | RESOLVED FIXED | QA Contact: | Alexander Nyßen <nyssen> |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | unspecified | ||
| Target Milestone: | 3.10.0 (Mars) M6 | ||
| Hardware: | PC | ||
| OS: | Mac OS X | ||
| Whiteboard: | |||
|
Description
Alexander Nyßen
Added an SWT event filter to suppress mouse wheel events on devices that support touch (Display#getTouchEnabled()). While on Mac (where I could observe the synthetic events and could test the correct behavior with the applied filter), only vertical mouse wheel events seem to be transferred to the FXCanvas, I added the suppress filter also for horizontal mouse wheel events and for all touch devices (i.e. Display#getTouchEnabled() == true), just in case this occurs on other platforms as well (which I cannot confirm on my machine). We will have to test that the behavior is valid on other platforms than Mac to see if the behavior has to be adjusted in a platform-specific way. I assume there are no problems on other platforms and thus resolve it as fixed. We may reopen in case any problems are faced. Change component to FX, as SwtFX is succeeded by FX.UI. When scrolling via mouse wheel on devices where touch is enabled (display.isTouch()), the current workaround will not forward any valid scroll events (at least on the Mac). There, only scroll events with zero delta-x- and delta-y are delivered. Nevertheless, using the mouse wheel on such a platform is a valid gesture. Thus reopening this. I now re-implemented the solution two be based on two filters (mouse wheel and pan gesture) that filter out: 1) (invalid) pan gesture events that are emulated from mouse wheel events (they will provide a delta of 0 for x and y direction) 2) mouse wheel events that are emulated from pan gesture events (on devices that support touch); they can only be sorted out by keeping track of previous pan gesture events with the same x and y location. Verified that the behavior is now as desired on Mac, both using the mouse wheel as well as the touchpad: in both situations, appropriate JavaFX scroll events are now generated (while the step-width in case of gesture events is 5, and in case of mouse wheel events is 40). Resolving as fixed in 3.10.0M6. |