Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[macOS] Modify behaviour when last editor gets closed #8023

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

Merged
facchinm merged 1 commit into arduino:master from facchinm:new_behaviour_osx_close
Nov 23, 2018

Conversation

Copy link
Member

@facchinm facchinm commented Sep 21, 2018
edited
Loading

Fixes #8021 and #936

@facchinm facchinm changed the title (削除) [WIP] Modify behaviour of OSX close (削除ここまで) (追記) [macOS] Modify behaviour when last editor gets closed (追記ここまで) Sep 24, 2018
@facchinm facchinm added the OS: OSX Specific to the Mac OS X (macOS) version of the Arduino IDE label Sep 24, 2018
@facchinm facchinm added this to the Release 1.8.8 milestone Sep 24, 2018
@arduino arduino deleted a comment from ArduinoBot Sep 24, 2018
Copy link
Contributor

@sandeepmistry sandeepmistry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this out on macOS 10.12.6.

When I close all the IDE windows, the app now stays open. Cmd-N can be used to create a new sketch, same for File -> New


// This will store the sketch count as zero
editor.setVisible(false);
//editor.dispose();
Copy link
Contributor

@sandeepmistry sandeepmistry Sep 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove the commented code :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left it there for a reason :) On my trials, if dispose() gets called the toolbar doesn't disappear but clicking on any element has no effect. I believe it's a broader bug, since the toolbar handlers are declared inside the first Editor instance. If we refactor the code dispose() should be called, so it's more like a reminder :)

}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
Copy link
Contributor

@sandeepmistry sandeepmistry Sep 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better error handling here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely (no idea about how to handle it anyway)

Copy link
Contributor

gvarisco commented Sep 25, 2018
edited
Loading

@sandeepmistry same here, despite I've noticed that if you have multiple tabs and decide to close the first one, the app "goes away" (as in: stays in background, do not kill itself, but tabs are gone if you click again on it) instead of showing the other tabs kept open.

cc @facchinm

Copy link
Member Author

@gvarisco can you expand on that? The "new" behaviour should only kick in if a single Editor windows is open (multiple tabs on the same editor don't count they are part of an "atomic" sketch).
At reopen I asked @akash73 what is the expected behaviour for OSX users and we agreed to implement "new empty sketch" instead than "reopen last sketch". It can be changed of course 😉

Copy link
Contributor

Clarified with @facchinm - all good on my side. LGTM.

Don't call System.exit() but trust the ThinkDifferent handler
Handle reopen only if no editor is visible
Don't dispose last closing editor (so its toolbars are still in active state)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@cmaglie cmaglie Awaiting requested review from cmaglie

1 more reviewer

@sandeepmistry sandeepmistry sandeepmistry left review comments

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
OS: OSX Specific to the Mac OS X (macOS) version of the Arduino IDE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /