File tree 2 files changed +20
-4
lines changed
2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 49
49
import processing .app .debug .TargetPackage ;
50
50
import processing .app .debug .TargetPlatform ;
51
51
import processing .app .helpers .*;
52
+ import processing .app .helpers .OSUtils ;
52
53
import processing .app .helpers .filefilters .OnlyDirs ;
53
54
import processing .app .helpers .filefilters .OnlyFilesWithExtension ;
54
55
import processing .app .javax .swing .filechooser .FileNameExtensionFilter ;
@@ -931,15 +932,14 @@ public boolean handleClose(Editor editor) {
931
932
}
932
933
933
934
if (editors .size () == 1 ) {
934
-
935
+ editor .setVisible (false );
936
+ editors .remove (editor );
935
937
handleQuit ();
936
-
937
938
} else {
938
939
// More than one editor window open,
939
940
// proceed with closing the current window.
940
941
editor .setVisible (false );
941
942
editor .dispose ();
942
-
943
943
editors .remove (editor );
944
944
}
945
945
return true ;
@@ -974,7 +974,7 @@ public boolean handleQuit() {
974
974
// Save out the current prefs state
975
975
PreferencesData .save ();
976
976
977
- if (!OSUtils .hasMacOSStyleMenus ()) {
977
+ if (!OSUtils .isMacOS ()) {
978
978
// If this was fired from the menu or an AppleEvent (the Finder),
979
979
// then Mac OS X will send the terminate signal itself.
980
980
System .exit (0 );
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