kwhat / jnativehook

Global keyboard and mouse listeners for Java.
Other
1.73k stars 344 forks source link

GlobalScreen.unregisterNativeHook() causing 'System.exit(1)' on linux. #200

Open martin-mucha opened 6 years ago

martin-mucha commented 6 years ago

I have simple code to unregister jnativehook:

try { GlobalScreen.unregisterNativeHook(); } catch (NativeHookException e) { logger.error("Failed to stop JNativeHook.", e); }

No exception is not caught. Even if I change code to catch Exception, no exception. On windows, whole app works great, unregister works, hook unregisters itself, app closes itself correctly with exit code 0. On linux (xfce fedora 26) though, call to GlobalScreen.unregisterNativeHook(); causes immediate JVM exit with exit code 1. There's still termination code which has to be executed, but it's never reached. Ie. it really behaves like if there's System.exit(1). I assume this is not how it should behave.

I did not see any error message. If you need any extra information / testing, please request it.

xeruf commented 6 years ago

Same for me on Linux mint. Any news?

sghpjuikit commented 6 years ago

I'm running a virtualized Mint OS inside VMware and can not reproduce the issue within the same application as @Xerus2000 . However, this appears to be a critical issue to me.

kwhat commented 6 years ago

Version 2.1 of the library? I will see if I can reproduce today.

kwhat commented 6 years ago

Ok, I am not seeing this issue with the demo program and the latest 2.1 commit. I am going to do a 2.1.1 soon, so please test that when it becomes available.

sghpjuikit commented 6 years ago

I will test 2.1.1.

xeruf commented 5 years ago

Any progress?