• R/O
  • SSH
  • HTTPS

util: Commit


Commit MetaInfo

Revisão244 (tree)
Hora2021-06-20 20:27:59
Autorhirukawa_ryo

Mensagem de Log

* fx-util 0.4.4
Windows以外では start 直前にスプラッシュスクリーンを非表示にするようにしました。
macOS でステージ表示後にスプラッシュスクリーンが一瞬前面に出てきてしまう問題への対処のためです。

Mudança Sumário

Diff

--- fx-util/trunk/src/main/java/net/osdn/util/javafx/application/SingletonApplication.java (revision 243)
+++ fx-util/trunk/src/main/java/net/osdn/util/javafx/application/SingletonApplication.java (revision 244)
@@ -214,15 +214,24 @@
214214 public void start(Stage stage) throws Exception {
215215 fxApplicationThread = Thread.currentThread();
216216 primaryStage = stage;
217- stage.addEventHandler(WindowEvent.WINDOW_SHOWN, new EventHandler<WindowEvent>() {
218- @Override
219- public void handle(WindowEvent windowEvent) {
220- Platform.runLater(() -> {
221- closeSplashScreen();
222- });
223- primaryStage.removeEventHandler(windowEvent.getEventType(), this);
217+
218+ boolean isWindows = System.getProperty("os.name", "").toLowerCase().startsWith("windows");
219+ if(isWindows) {
220+ stage.addEventHandler(WindowEvent.WINDOW_SHOWN, new EventHandler<WindowEvent>() {
221+ @Override
222+ public void handle(WindowEvent windowEvent) {
223+ Platform.runLater(() -> {
224+ closeSplashScreen();
225+ });
226+ primaryStage.removeEventHandler(windowEvent.getEventType(), this);
227+ }
228+ });
229+ } else {
230+ SplashScreen splash = SplashScreen.getSplashScreen();
231+ if(splash != null) {
232+ splash.close();
224233 }
225- });
234+ }
226235 app.start(stage);
227236 latch.countDown();
228237 }
Show on old repository browser