Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quitting an FX2D app (via ESC or cmd-Q) on macOS throws IllegalStateException #4

Open
benfry opened this issue Sep 5, 2017 · 4 comments
Labels
help wanted Many hands make light work. Please help!

Comments

@benfry
Copy link
Contributor

benfry commented Sep 5, 2017

Using ESC to quit an app results in

java.lang.IllegalStateException: Not on FX application thread; currentThread = JavaFX Application Thread
	at com.sun.javafx.tk.Toolkit.checkFxUserThread(Toolkit.java:236)
	at com.sun.javafx.tk.quantum.QuantumToolkit.checkFxUserThread(QuantumToolkit.java:423)
	at javafx.stage.Window.setShowing(Window.java:921)
	at javafx.stage.Window.hide(Window.java:947)
	at com.sun.javafx.stage.WindowPeerListener.closed(WindowPeerListener.java:100)
	at com.sun.javafx.tk.quantum.GlassWindowEventHandler.run(GlassWindowEventHandler.java:119)
	at com.sun.javafx.tk.quantum.GlassWindowEventHandler.run(GlassWindowEventHandler.java:40)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.tk.quantum.GlassWindowEventHandler.lambda$handleWindowEvent$423(GlassWindowEventHandler.java:151)
	at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
	at com.sun.javafx.tk.quantum.GlassWindowEventHandler.handleWindowEvent(GlassWindowEventHandler.java:149)
	at com.sun.glass.ui.Window.handleWindowEvent(Window.java:1266)
	at com.sun.glass.ui.Window.notifyDestroy(Window.java:1183)
@benfry benfry changed the title Hitting ESC in FX2D app on macOS throws IllegalStateException Quitting an FX2D app (via ESC or cmd-Q) on macOS throws IllegalStateException Oct 19, 2017
@christianbender
Copy link

@benfry I tested it on linux (Linux Mint 18.2 ) and it works fine.

void setup() {
  size(200, 200, FX2D);
}

void draw() {
}

If I typed ESC the program terminates without error messages.

@hkiel
Copy link

hkiel commented Jul 1, 2018

The same happens here on macOS.

@hkiel
Copy link

hkiel commented Jul 12, 2018

I seem to have fixed that issue on macOS (#5574). Cannot check other architectures, though...

@benfry benfry transferred this issue from processing/processing Jan 16, 2022
@benfry benfry added the help wanted Many hands make light work. Please help! label Jan 16, 2022
@benfry
Copy link
Contributor Author

benfry commented Jan 24, 2022

Still need help with a fix for this one… Stack trace from the beta 4 release:

java.lang.IllegalStateException: Not on FX application thread; currentThread = JavaFX Application Thread
	at javafx.graphics/com.sun.javafx.tk.Toolkit.checkFxUserThread(Toolkit.java:295)
	at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.checkFxUserThread(QuantumToolkit.java:458)
	at javafx.graphics/javafx.stage.Window.setShowing(Window.java:1189)
	at javafx.graphics/javafx.stage.Window.hide(Window.java:1215)
	at javafx.graphics/com.sun.javafx.stage.WindowPeerListener.closed(WindowPeerListener.java:105)
	at javafx.graphics/com.sun.javafx.tk.quantum.GlassWindowEventHandler.run(GlassWindowEventHandler.java:144)
	at javafx.graphics/com.sun.javafx.tk.quantum.GlassWindowEventHandler.run(GlassWindowEventHandler.java:40)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at javafx.graphics/com.sun.javafx.tk.quantum.GlassWindowEventHandler.lambda$handleWindowEvent$4(GlassWindowEventHandler.java:178)
	at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
	at javafx.graphics/com.sun.javafx.tk.quantum.GlassWindowEventHandler.handleWindowEvent(GlassWindowEventHandler.java:176)
	at javafx.graphics/com.sun.glass.ui.Window.handleWindowEvent(Window.java:1336)
	at javafx.graphics/com.sun.glass.ui.Window.notifyDestroy(Window.java:1250)
IllegalStateException: Not on FX application thread; currentThread = JavaFX Application Thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Many hands make light work. Please help!
Projects
None yet
Development

No branches or pull requests

3 participants