File tree 2 files changed +24
-3
lines changed
2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 48
48
import processing .app .debug .TargetPackage ;
49
49
import processing .app .debug .TargetPlatform ;
50
50
import processing .app .helpers .*;
51
+ import processing .app .helpers .OSUtils ;
51
52
import processing .app .helpers .filefilters .OnlyDirs ;
52
53
import processing .app .helpers .filefilters .OnlyFilesWithExtension ;
53
54
import processing .app .javax .swing .filechooser .FileNameExtensionFilter ;
@@ -935,7 +936,10 @@ public boolean handleClose(Editor editor) {
935
936
storeSketches ();
936
937
937
938
// This will store the sketch count as zero
939
+ editor .setVisible (false );
940
+ //editor.dispose();
938
941
editors .remove (editor );
942
+
939
943
try {
940
944
Editor .serialMonitor .close ();
941
945
} catch (Exception e ) {
@@ -946,9 +950,10 @@ public boolean handleClose(Editor editor) {
946
950
// Save out the current prefs state
947
951
PreferencesData .save ();
948
952
949
- // Since this wasn't an actual Quit event, call System.exit()
950
- System .exit (0 );
951
-
953
+ // Since this wasn't an actual Quit event, call System.exit() (not on OSX)
954
+ if (!OSUtils .isMacOS ()) {
955
+ System .exit (0 );
956
+ }
952
957
} else {
953
958
// More than one editor window open,
954
959
// proceed with closing the current window.
Original file line number Diff line number Diff line change 23
23
package processing .app .macosx ;
24
24
25
25
import com .apple .eawt .*;
26
+ import com .apple .eawt .AppEvent .AppReOpenedEvent ;
27
+
26
28
import processing .app .Base ;
27
29
import processing .app .Editor ;
28
30
@@ -45,6 +47,20 @@ public class ThinkDifferent {
45
47
46
48
static public void init () {
47
49
Application application = Application .getApplication ();
50
+
51
+ application .addAppEventListener (new AppReOpenedListener () {
52
+ @ Override
53
+ public void appReOpened (AppReOpenedEvent aroe ) {
54
+ try {
55
+ if (Base .INSTANCE .getEditors ().size () == 0 ) {
56
+ Base .INSTANCE .handleNew ();
57
+ }
58
+ } catch (Exception e ) {
59
+ // TODO Auto-generated catch block
60
+ e .printStackTrace ();
61
+ }
62
+ }
63
+ });
48
64
application .setAboutHandler (new AboutHandler () {
49
65
@ Override
50
66
public void handleAbout (AppEvent .AboutEvent aboutEvent ) {
You can’t perform that action at this time.
0 commit comments