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

MacOS CocoaProvider uses SwingUtilities.invokeLater() and forces the use of AWT/Swing #13

Open
Ant01n3 opened this issue Mar 7, 2018 · 1 comment

Comments

@Ant01n3
Copy link

Ant01n3 commented Mar 7, 2018

First of all thanks a lot for this library.

All works well when working with Swing or AWT.

However as soon as we want to use the library with another toolkit (I was trying LWJGL and GLFW), and only under MacOS, no event are issued until one create a JFrame (or any Swing or AWT component) before using the library. This is problematic to use two frameworks at the same time.

Indeed an "AWT event dispatch thread" must be running for the Cocoa provider to work. This is needed since in "CocoaAccess.java" a call to SwingUtilities.isEventDispatchThread() and/or SwingUtilities.invokeLater() is used to schedule level events. When not using these toolkits, disabling the use of these SwingUtilities works very well and remove the dependency to these toolkits. If I understand well the code, the use of invokeLater() is however needed when working with AWT/Swing. Could this be activated only optionally ?

Thanks

@Ant01n3
Copy link
Author

Ant01n3 commented Mar 7, 2018

Passing an option (useSwing ?) to CocoaProvider.Constructor() could maybe solve the problem ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant