korlibs / korlibs/korge

[Nit Bug] Mac touchpad zoom in finger gesture on a JVM app window creates error log noise.

Open
#2,142 2 comments 0 reactions 0 assignees View on GitHub
check
Dominant language
Kotlin
Stars
3k
Forks
148
Avg merge
13h 44m
Merged PRs (30d)
1

Description

# Repro steps
1. Run `runJvmAutoReload` on any Korge project. Hello World is fine.
2. With the cursor on the newly launched app window, do a zoom in gesture on the mac trackpad. You know the one, with two fingers, like on an iphone.
3. Your log windows will fill up with scary looking `Console.error` level log noise:
```
Exception in thread "AppKit Thread" java.lang.NoSuchMethodError: Lcom/apple/eawt/event/GestureHandler;.handleGestureFromNative(Ljava/awt/Window;IDDDD)V
2024-01-31 19:37:10.289 java[29876:3307781] Bad JNI lookup handleGestureFromNative
2024-01-31 19:37:10.290 java[29876:3307781] (
0 libawt_lwawt.dylib 0x0000000128401a20 -[AWTWindow_Normal postGesture:as:a:b:] + 944
1 AppKit 0x00007ff814c65f7e forwardMethod + 311
2 AppKit 0x00007ff814be5736 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 856
3 AppKit 0x00007ff814be51c3 -[NSWindow(NSEventRouting) sendEvent:] + 345
4 libawt_lwawt.dylib 0x0000000128401657 -[AWTWindow_Normal sendEvent:] + 87
5 AppKit 0x00007ff81537d6b0 routeGestureEvent + 393
6 AppKit 0x00007ff81537c977 -[NSApplication(NSEventRouting) sendEvent:] + 2239
7 libosxapp.dylib 0x000000012773c765 -[NSApplicationAWT sendEvent:] + 437
8 AppKit 0x00007ff814f38b93 -[NSApplication _handleEvent:] + 65
9 AppKit 0x00007ff814a76d57 -[NSApplication run] + 640
10 libosxapp.dylib 0x000000012773c365 +[NSApplicationAWT runAWTLoopWithApp:] + 165
11 libawt_lwawt.dylib 0x0000000128458d40 +[AWTStarter starter:headless:] + 496
12 libosxapp.dylib 0x000000012773e04f +[ThreadUtilities invokeBlockCopy:] + 15
13 Foundation 0x00007ff812431bd5 __NSThreadPerformPerform + 178
14 CoreFoundation 0x00007ff8115177d6 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
15 CoreFoundation 0x00007ff811517779 __CFRunLoopDoSource0 + 157
16 CoreFoundation 0x00007ff811517548 __CFRunLoopDoSources0 + 215
17 CoreFoundation 0x00007ff8115161b8 __CFRunLoopRun + 919
18 CoreFoundation 0x00007ff811515859 CFRunLoopRunSpecific + 557
19 libjli.dylib 0x0000000109520132 CreateExecutionEnvironment + 386
20 libjli.dylib 0x000000010951bc96 JLI_Launch + 1366
21 java 0x0000000100ba2c0a main + 394
22 dyld 0x0000000200c45386 start + 1942
)
```
![Screenshot 2024-01-31 at 7 42 48 PM](https://github.com/korlibs/korge/assets/10100613/cd0ec2e8-fcf3-4aff-a17d-b20a47f7a8ad)

4. Done

# Impact
I believe this is just a scary looking message, but it may confuse the developer, especially new folks trying the Hello World app who may have accidentally triggered this behavior.

# Possible Solution
Since its a `java.lang.NoSuchMethodErro`, seems like these gestures just have to be handled with a default no-op listener? I have no idea.

# Details
- M1 Mac
- Korge version `5.3.0`

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue by running `runJvmAutoReload` on macOS and performing a two-finger zoom gesture in the app window. Start from the `NoSuchMethodError` and `Bad JNI lookup handleGestureFromNative` stack trace, then trace the JVM/macOS gesture handling; done means the gesture no longer produces repeated error-level log noise.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.