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

[macosx] MouseEvent can have popupTrigger set to true unexpectedly


    • 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:


      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:


      <<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).




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


              • Created: