Skip to content
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

Fallback to OS-independent file-saving dialog on macOS #1147

Merged
merged 1 commit into from
May 9, 2023

Conversation

gouttegd
Copy link
Collaborator

@gouttegd gouttegd commented May 9, 2023

This PR implements a workaround for the file-saving issue reported in #1106.

On macOS, if we don’t get a File from the macOS-specific MacUIUtil#saveFile() method, we assume this is due to a failure of that method (or of the underlying JRE) to even show the native file-choosing dialog (as was shown to happen in #1106), and we fallback to the OS-independent method instead of aborting the file-saving operation entirely.

This allow users affected by the “never-showing-native-dialog“ bug to still save their files, at the price of asking users not affected by that same bug to click “cancel” on two consecutive dialogs if they do want to cancel the save operation at the file-choosing step.

On macOS, if we don't get a File from the macOS-specific
MacUIUtil#saveFile() method, assume this is due to a failure of that
method (or of the underlying JRE) to even show the native file-choosing
dialog (as was shown to happen, #1106), and fallback to the
OS-independent method.

This allow users affected by the "never-showing-native-dialog" bug to
still save their files, at the price of asking users not affected by
that same bug to click "cancel" on two consecutive dialogs if they do
want to cancel the save operation at the file-choosing step.
@gouttegd gouttegd self-assigned this May 9, 2023
@matthewhorridge matthewhorridge merged commit 48eb376 into master May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants