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

[macos] Screen magnifier does not show the magnified text for JComboBox

    XMLWordPrintable

Details

    Description

      I have a JFrame with JLabel and JComboBox. I was trying Screen magnifier on macOS.
      I enabled Hover Text in Zoom section in Accessibility settings of macOS. I see that native combo box shows large-text view of the item under the pointer but JComboBox doesn't.

      Steps to reproduce
      --------------------------
      1) Enable Screen magnifier on Mac
      System Preferences -> Accessibility -> Zoom -> Select (Enable Hover Text)
      2) Run the attached code by passing the following option
       -Djavax.accessibility.screen_magnifier_present=true JComboBoxScreenMagnifierBug.java

      3) Once the JFrame is visible, press the Command (Cmd) key and move mouse over JLabel (Fruits), you should see "Fruits" with magnified or enlarged text.
      4) Move the mouse pointer over JComboBox. If you don't see the magnified text, then the bug is reproduced.



      Note: I am getting the following exception in JDK 17 b35, but it's not reproduced in JDK 18 b36 and JDK 19 b13. This exception is seen when user presses the Command key and moves the mouse pointer over a Swing component

      2022-03-15 13:14:57.419 java[22109:3940166] Bad JNI lookup accessibilityHitTest
      2022-03-15 13:14:57.420 java[22109:3940166] (
      0 libawt_lwawt.dylib 0x0000000105efa3d9 -[JavaComponentAccessibility accessibilityHitTest:withEnv:] + 153
      1 libawt_lwawt.dylib 0x0000000105ea6573 -[AWTView accessibilityHitTest:] + 179
      2 AppKit 0x00007fff23a20b51 -[NSWindow(NSWindowAccessibility) accessibilityHitTest:] + 309
      3 AppKit 0x00007fff235c490c -[NSApplication(NSApplicationAccessibility) accessibilityHitTest:] + 342
      4 AppKit 0x00007fff235957f3 CopyElementAtPosition + 150
      5 HIServices 0x00007fff25c0aa2b _AXXMIGCopyElementAtPosition + 336
      6 HIServices 0x00007fff25c2b708 _XCopyElementAtPosition + 369
      7 HIServices 0x00007fff25be993c mshMIGPerform + 182
      8 CoreFoundation 0x00007fff20955b04 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
      9 CoreFoundation 0x00007fff209559e5 __CFRunLoopDoSource1 + 619
      10 CoreFoundation 0x00007fff2095406f __CFRunLoopRun + 2400
      11 CoreFoundation 0x00007fff2095304c CFRunLoopRunSpecific + 563
      12 HIToolbox 0x00007fff28b9ba83 RunCurrentEventLoopInMode + 292
      13 HIToolbox 0x00007fff28b9b6b6 ReceiveNextEventCommon + 284
      14 HIToolbox 0x00007fff28b9b583 _BlockUntilNextEventMatchingListInModeWithFilter + 70
      15 AppKit 0x00007fff2315bd72 _DPSNextEvent + 864
      16 AppKit 0x00007fff2315a545 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1364
      17 libosxapp.dylib 0x0000000105fb659a -[NSApplicationAWT nextEventMatchingMask:untilDate:inMode:dequeue:] + 122
      18 AppKit 0x00007fff2314c869 -[NSApplication run] + 586
      19 libosxapp.dylib 0x0000000105fb6369 +[NSApplicationAWT runAWTLoopWithApp:] + 169
      20 libawt_lwawt.dylib 0x0000000105f02830 +[AWTStarter starter:headless:] + 496
      21 libosxapp.dylib 0x0000000105fb803f +[ThreadUtilities invokeBlockCopy:] + 15
      22 Foundation 0x00007fff21704b91 __NSThreadPerformPerform + 204
      23 CoreFoundation 0x00007fff2095537c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
      24 CoreFoundation 0x00007fff209552e4 __CFRunLoopDoSource0 + 180
      25 CoreFoundation 0x00007fff20955064 __CFRunLoopDoSources0 + 242
      26 CoreFoundation 0x00007fff20953a8c __CFRunLoopRun + 893
      27 CoreFoundation 0x00007fff2095304c CFRunLoopRunSpecific + 563
      28 libjli.dylib 0x00000001059ce0b2 CreateExecutionEnvironment + 386
      29 libjli.dylib 0x00000001059c9c15 JLI_Launch + 1413
      30 java 0x00000001059b9c09 main + 393
      31 libdyld.dylib 0x00007fff20878f3d start + 1
      )
      Exception in thread "AppKit Thread" java.lang.NoSuchMethodError: accessibilityHitTest

      Attachments

        Issue Links

          Activity

            People

              abhiscxk Abhishek Kumar
              landrews Lawrence Andrews
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: