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

[macosx] MouseEvent can have popupTrigger set to true unexpectedly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3
    • tbd
    • 7u40, 8, 9
    • client-libs
    • Fix Understood
    • 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

            Unassigned Unassigned
            ant Anton Tarasov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: