-
Notifications
You must be signed in to change notification settings - Fork 9
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
Application crashes when I click on another window. #8
Comments
So the sandbox is really only for use in development mode for fast iterations (it has refresh support - activated by hitting F5). When you're building an uberjar, you want to launch your view with some other method. FWIW, here's a simplified version of what my app uses: (ns my-app.main
(:gen-class)
(:require
[my-app.core :refer [my-app-view]]
[fx-clj.core :as fx])
(:import (javafx.stage Modality)
(java.awt SplashScreen)))
(defn start-app
[app-fn & {:keys [title maximized]}]
(fx/run<!!
(let [scene (fx/scene (app-fn))
stage (fx/stage)]
(.setScene stage scene)
(.initModality stage Modality/NONE)
(fx/pset! stage {:title title})
(when maximized (.setMaximized stage true))
(.show stage)
(let [splash-screen (SplashScreen/getSplashScreen)]
(when splash-screen
(try
(.close splash-screen)
(catch Exception ex))))
stage)))
(defn -main [& args]
(start-app my-app-view
:title "MyApp"
:maximized true))
|
I get the same behavior with that. I created a repo that shows this in action: https://github.com/uris77/my-fx |
I've increased the time the application stays up by re-writing |
Nevermind my previous comment about disabling |
When I run the ubjerar, the application always crashes when I click on some other window (e.g. change tabs on a browser, or double click on the terminal). It doesn't crash in dev mode. Here is the sample core.clj I'm using:
The text was updated successfully, but these errors were encountered: