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

FXCanvas does not forward touch gestures to embedded scene

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      other

      Description

      FULL PRODUCT VERSION :


      ADDITIONAL OS VERSION INFORMATION :
      Non OS-specific problem.

      A DESCRIPTION OF THE PROBLEM :
      As reported in JDK-8088262 already, FXCanvas does not forward any touch gesture events to the embedded scene.

      The Eclipse GEF project provides an FXCanvasEx to compensate this problem (http://git.eclipse.org/c/gef/org.eclipse.gef4.git/tree/org.eclipse.gef4.fx.swt/src/org/eclipse/gef4/fx/swt/canvas/FXCanvasEx.java).

      It internally uses a modified version of the helper class (http://git.eclipse.org/c/gef/org.eclipse.gef4.git/tree/org.eclipse.gef4.fx.swt/src/org/eclipse/gef4/fx/swt/gestures/SwtToFXGestureConverter.java) mentioned by Jan Köhnlein in JDK-8088262.

      However, this helper class accesses JDK internal API, so that the workaround will probably not work with Jigsaw:

      bin -> javafx.graphics
         org.eclipse.gef4.fx.swt.gestures.SwtToFXGestureConverter (bin)
            -> com.sun.javafx.tk.TKSceneListener JDK internal API (javafx.graphics)
         org.eclipse.gef4.fx.swt.gestures.SwtToFXGestureConverter$3$1 (bin)
            -> com.sun.javafx.tk.TKSceneListener JDK internal API (javafx.graphics)

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Have full support for forwarding touch gesture events to the embedded scene within FXCanvas.
      ACTUAL -
      No touch gesture events are forwarded by FXCanvas.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      1. JDK-8143596.17_08_16.patch
        36 kB
        Kevin Rushforth
      2. JDK-8143596.18_08_16.patch
        36 kB
        Kevin Rushforth
      3. JDK-8143596.09_09_16.patch
        40 kB
        Alexander Nyssen

        Issue Links

          Activity

          Hide
          azvegint Alexander Zvegintsev added a comment -
          The fix looks good to me.
          I have only one minor comment: I think that we shouldn't throw IllegalStateException in sendGestureEventToFX in FXCanvas. It might break this function's behavior, if some new gesture(unlikely, but who knows) will be added.
          Show
          azvegint Alexander Zvegintsev added a comment - The fix looks good to me. I have only one minor comment: I think that we shouldn't throw IllegalStateException in sendGestureEventToFX in FXCanvas. It might break this function's behavior, if some new gesture(unlikely, but who knows) will be added.
          Hide
          anyssen Alexander Nyssen added a comment -
          I have uploaded an updated webrev to http://cr.openjdk.java.net/~anyssen/8143596/webrev.01/. The IllegalStateException is no longer thrown, unknown gesture events are now simply ignored. I have also fixed some whitespace issues.
          Show
          anyssen Alexander Nyssen added a comment - I have uploaded an updated webrev to http://cr.openjdk.java.net/~anyssen/8143596/webrev.01/ . The IllegalStateException is no longer thrown, unknown gesture events are now simply ignored. I have also fixed some whitespace issues.
          Hide
          azvegint Alexander Zvegintsev added a comment -
          looks good to me.
          Show
          azvegint Alexander Zvegintsev added a comment - looks good to me.
          Hide
          kcr Kevin Rushforth added a comment -
          I verified that it compiles and doesn't break the build and that the existing unit tests still run. I was on Linux, so couldn't test the actual gesture code.

          [~azvegint] If you are happy with it, then go ahead and push it.
          Show
          kcr Kevin Rushforth added a comment - I verified that it compiles and doesn't break the build and that the existing unit tests still run. I was on Linux, so couldn't test the actual gesture code. [~azvegint] If you are happy with it, then go ahead and push it.
          Show
          azvegint Alexander Zvegintsev added a comment - http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/d1e9b7548bd0

            People

            • Assignee:
              anyssen Alexander Nyssen
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: