Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8161282

FXCanvas does not forward horizontal mouse scroll events to the embedded scene

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      other

      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.

      1. JDK-8161282_16_08_16.patch
        18 kB
        Kevin Rushforth
      2. JDK-8161282_15_08_16.patch
        19 kB
        Kevin Rushforth

        Issue Links

          Activity

          Hide
          aroy Abhijit Roy (Inactive) added a comment - - edited
          This is a duplicate issue of JDK-8143596. So, closing this issue as closed/duplicate.
          Show
          aroy Abhijit Roy (Inactive) added a comment - - edited This is a duplicate issue of JDK-8143596 . So, closing this issue as closed/duplicate.
          Hide
          kcr Kevin Rushforth added a comment -
          Reopening per additional information from bug submitter.
          Show
          kcr Kevin Rushforth added a comment - Reopening per additional information from bug submitter.
          Hide
          kcr Kevin Rushforth added a comment -
          Attached patch provided by Alexander Nyseen.
          Show
          kcr Kevin Rushforth added a comment - Attached patch provided by Alexander Nyseen.
          Hide
          kcr Kevin Rushforth added a comment - - edited
          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.
          Show
          kcr Kevin Rushforth added a comment - - edited 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 .
          Hide
          kcr Kevin Rushforth added a comment -
          Attached update patch from Alexander Nyssen.
          Show
          kcr Kevin Rushforth added a comment - Attached update patch from Alexander Nyssen.
          Hide
          kcr Kevin Rushforth added a comment -
          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.
          Show
          kcr Kevin Rushforth added a comment - 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.
          Hide
          kcr Kevin Rushforth added a comment -
          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.
          Show
          kcr Kevin Rushforth added a comment - 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.
          Hide
          kcr Kevin Rushforth added a comment - - edited
          Approved, assuming the changes to the wild-import are done by Alexander Z along with a correctly formatted changeset commit message.

          +1
          Show
          kcr Kevin Rushforth added a comment - - edited Approved, assuming the changes to the wild-import are done by Alexander Z along with a correctly formatted changeset commit message. +1
          Show
          azvegint Alexander Zvegintsev (Inactive) added a comment - http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/75f70aa755e1

            People

            • Assignee:
              azvegint Alexander Zvegintsev (Inactive)
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: