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

Exceptions after a touchpad gesture on macOS

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b19
    • OS:
      os_x

      Backports

        Description

        With latest JDK version, performing touchpad gestures over a Java application's window causes error messages to be printed to console.
        To reproduce, launch the sample program (with source code given below) on a MacBook, and perform a magnification (two-finger pinch) gesture over the
        opened window. The following messages appear in console:

        2021-10-12 13:52:37.454 java[25747:1001960] Bad JNI lookup handleGestureFromNative
        2021-10-12 13:52:37.455 java[25747:1001960] (
        0 libawt_lwawt.dylib 0x000000010c0110d0 -[AWTWindow_Normal postGesture:as:a:b:] + 944
        1 AppKit 0x00007fff22f444e8 forwardMethod + 204
        2 AppKit 0x00007fff22ebb578 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 6482
        3 AppKit 0x00007fff22eb9a06 -[NSWindow(NSEventRouting) sendEvent:] + 347
        4 libawt_lwawt.dylib 0x000000010c010d07 -[AWTWindow_Normal sendEvent:] + 87
        5 AppKit 0x00007fff234aa954 routeGestureEvent + 389
        6 AppKit 0x00007fff22eb8803 -[NSApplication(NSEvent) sendEvent:] + 2895
        7 libosxapp.dylib 0x0000000105f38765 -[NSApplicationAWT sendEvent:] + 437
        8 AppKit 0x00007fff23190be1 -[NSApplication _handleEvent:] + 65
        9 AppKit 0x00007fff22d20c8e -[NSApplication run] + 623
        10 libosxapp.dylib 0x0000000105f38369 +[NSApplicationAWT runAWTLoopWithApp:] + 169
        11 libawt_lwawt.dylib 0x000000010c068830 +[AWTStarter starter:headless:] + 496
        12 libosxapp.dylib 0x0000000105f3a03f +[ThreadUtilities invokeBlockCopy:] + 15
        13 Foundation 0x00007fff212d8b81 __NSThreadPerformPerform + 204
        14 CoreFoundation 0x00007fff205292bc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
        15 CoreFoundation 0x00007fff20529224 __CFRunLoopDoSource0 + 180
        16 CoreFoundation 0x00007fff20528fa4 __CFRunLoopDoSources0 + 242
        17 CoreFoundation 0x00007fff205279cc __CFRunLoopRun + 893
        18 CoreFoundation 0x00007fff20526f8c CFRunLoopRunSpecific + 563
        19 libjli.dylib 0x0000000105a280b2 CreateExecutionEnvironment + 386
        20 libjli.dylib 0x0000000105a23c15 JLI_Launch + 1413
        21 java 0x0000000105a11c11 main + 401
        22 libdyld.dylib 0x00007fff2044cf3d start + 1
        )
        Exception in thread "AppKit Thread" java.lang.NoSuchMethodError: Lcom/apple/eawt/event/GestureHandler;.handleGestureFromNative(Ljava/awt/Window;IDDDD)V

        The issue is reproducible for JDK 17 and 11.0.12 versions, but not for 16.0.2 or 11.0.11 versions.

        ----------- Sample program source code start -----------
        import javax.swing.*;

        public class JFrameTest {
            public static void main(String[] args) {
                SwingUtilities.invokeLater(() -> {
                    JFrame f = new JFrame();
                    f.setBounds(300, 300, 300, 300);
                    f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
                    f.setVisible(true);
                });
            }
        }
        ----------- Sample program source code end -----------

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                dbatrak Dmitry Batrak
                Reporter:
                dbatrak Dmitry Batrak
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: