JDK-8161282 : FXCanvas does not forward horizontal mouse scroll events to the embedded scene
  • Type: Bug
  • Component: javafx
  • Sub-Component: other
  • Affected Version: 8u92,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: other
  • CPU: x86
  • Submitted: 2016-06-28
  • Updated: 2017-06-08
  • Resolved: 2016-09-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Fixed
Related Reports
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION :


A DESCRIPTION OF THE PROBLEM :
Horizontal mouse wheel events that are not synthesized from pan events (i.e. events of type SWT.MouseHorizontalWheel) are not forwarded to the embedded scene by FXCanvas, while vertical mouse wheel events are. Similar to touch events (see JDK-8143596), these events are thus not received by the JavaFX scene.

The FXCanvasEx implementation provided by the Eclipse GEF project (or more precisely the gesture converter used by it internally: http://git.eclipse.org/c/gef/org.eclipse.gef4.git/tree/org.eclipse.gef4.fx.swt/src/org/eclipse/gef4/fx/swt/gestures/SWT2FXEventConverter.java) compensates this. However, the fix relies on internal API of JavaFX and will no longer work under the restrictions of Jigsaw.


REPRODUCIBILITY :
This bug can be reproduced always.


Comments
http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/75f70aa755e1
07-09-2016

Approved, assuming the changes to the wild-import are done by Alexander Z along with a correctly formatted changeset commit message. +1
07-09-2016

Raising the priority to P3 since the current workaround for JDK 8 will no longer work in JDK 9 due to its reliance on internal packages.
01-09-2016

Here are the notes from the patch itself (since they cannot be part of the commit message, but belong here). --------------------------- - Extended EmbeddedSceneInterface and EmbeddedScene to support propagation of scroll events. - Extended FXCanvas to handle SWT.MouseHorizontalWheel events in addition to SWT.MouseVerticalWheel (= SWT.MouseWheel) events. Separated handling of mouse wheel events from handling of mouse events. - Adjusted JFXPanel to use separate method to forward scroll event to EmbeddedScene. - Added manual test for forwarding of scroll events.
17-08-2016

Attached update patch from Alexander Nyssen.
17-08-2016

Comments from Alexander N: ------------------------ The patch is not as minimal as I had hoped, as the EmbeddedSceneInterface had to be changed to differentiate between mouse and scroll events (while up to now, scroll events are handled as mouse events), but for me this seemed necessary to fix this issue properly. As a result, JFXPanel had to be adjusted as well to comply to the changes in the EmbeddedSceneInterface, while its behavior should not have changed. As horizontal mouse events cannot be synthesized via Display.post(Event) yet (an open issue for SWT), I did not add an automated test, but instead added a manual one (FXCanvasMouseWheelEventsTest). Therefore, this patch does not depend on the patch I provided earlier for JDK-8160325.
15-08-2016

Attached patch provided by Alexander Nyseen.
15-08-2016

Reopening per additional information from bug submitter.
20-07-2016

This is a duplicate issue of JDK-8143596. So, closing this issue as closed/duplicate.
13-07-2016