File tree 3 files changed +15
-5
lines changed
src/main/java/com/airsquared/blobsaver
3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,9 @@ static void startBackground(boolean runOnlyOnce) {
79
79
return ;
80
80
}
81
81
if (!runOnlyOnce && Platform .isFxApplicationThread ()) {
82
- Main .hideStage ();
82
+ if (Main .primaryStage .isShowing ()) {
83
+ Main .hideStage ();
84
+ }
83
85
Notification .Notifier .INSTANCE .setPopupLifetime (Duration .seconds (30 ));
84
86
Notification .Notifier .INSTANCE .notifyInfo ("Background process has started" , "Check your system tray/status bar for\n the icon."
85
87
+ presetsToSaveNames .toString ().substring (1 , presetsToSaveNames .toString ().length () - 1 ));
Original file line number Diff line number Diff line change @@ -464,7 +464,9 @@ public void savePresetHandler() {
464
464
public void checkBlobs () { openURL ("https://tsssaver.1conan.com/check.php" ); }
465
465
466
466
public void helpLabelHandler (MouseEvent evt ) {
467
- if (Main .SHOW_BREAKPOINT ) return ; // remember to put a breakpoint here
467
+ if (Main .SHOW_BREAKPOINT ) {
468
+ return ; // remember to put a breakpoint here
469
+ }
468
470
469
471
String labelID ;
470
472
// if user clicks on question mark instead of padding, evt.getTarget() returns LabeledText instead of Label
Original file line number Diff line number Diff line change @@ -112,10 +112,16 @@ public void start(Stage primaryStage) throws IOException {
112
112
primaryStage .setResizable (false );
113
113
Controller .afterStageShowing ();
114
114
Platform .setImplicitExit (false );
115
+ showStage ();
115
116
if (appPrefs .getBoolean ("Start background immediately" , false )) {
116
- Background .startBackground (false );
117
- } else {
118
- showStage ();
117
+ /* I have to show the stage then hide it again in Platform.runLater() otherwise
118
+ * the needed initialization code won't run at the right time when starting the background
119
+ * (for example, the macOS menu bar won't work properly if I don't do this)
120
+ */
121
+ Platform .runLater (() -> {
122
+ hideStage ();
123
+ Background .startBackground (false );
124
+ });
119
125
}
120
126
121
127
//if in background, hide; else quit
You can’t perform that action at this time.
0 commit comments