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

[macosx] MouseEvent can have popupTrigger set to true unexpectedly

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: 7u40, 8, 9
    • Fix Version/s: tbd
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Understanding:
      Fix Understood
    • Introduced In Version:
    • OS:
      os_x

      Description

      The javadoc for MouseEvent.isPopupTrigger hints that only mouse event of type MOUSE_PRESSED or MOUSE_RELEASED can be considered a popup trigger across platforms:

      https://docs.oracle.com/javase/8/docs/api/java/awt/event/MouseEvent.html#isPopupTrigger--

      <<isPopupTrigger should be checked in both mousePressed and mouseReleased for proper cross-platform functionality>>

      This seems quite true. So, one would be right to expect that as long as the event is a popup trigger, it's either of "pressed" or "released" type.

      However, that is not the case on Mac, where a mouse event of other type can return true from its isPopupTrigger method. That's the way it is implemented. Unlike Windows or X11, where a mouse event, which is not "pressed" or "released", is always supplied "false" popupTrigger parameter on its construction. On Mac, this parameter is computed from the modifiers for any type of a mouse event which ends up with, say, MOUSE_EXITED having the popupTrigger set to true.

      This problem appears in JFX WebView component which just relies on the fact that only pressed/released mouse event can be a popup trigger. Please, find the testcase here: https://javafx-jira.kenai.com/browse/RT-39336. (Sorry for not providing a simple test case, I hope the issue is pretty clear w/o it).

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ant Anton Tarasov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: