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

Switch to JFileChooser on Mac with VAqua #88

Merged
merged 17 commits into from
Aug 15, 2020
Merged

Switch to JFileChooser on Mac with VAqua #88

merged 17 commits into from
Aug 15, 2020

Conversation

sampottinger
Copy link
Collaborator

@sampottinger sampottinger commented Apr 18, 2020

Due to the regression in FileDialog causing command c / command v to no longer work within FileDialog on Mac, having OS X use JFileChooser for the editor. This is keeping with the precedent set in processing/processing#1035. In response, switch to VAqua for a not terrible file mac-feel chooser (which also gives us dark mode!).

Resolves #77.
Resolves #89.

Blocked on #74.

Looks like constructor in Editor called from from JavaEditor is calling an overloaded method back in JavaEditor that expects debugger to have been initialized which is not possible since the parent constructor has not returned. This switches to loading debugger on demand (upon calling getDebugger) which allows for the Editor to use overloaded methods that expect debugger to be initialized.
Due to the regression in FileDialog causing command c / command v to no longer work within FileDialog on Mac, having OS X use JFileChooser for the editor. This is keeping with the precedent set in processing/processing#1035.
@sampottinger
Copy link
Collaborator Author

sampottinger commented Apr 19, 2020

I put this up because the precendent from processing/processing#1035 seems clear. That said, I'm on fence about this. I feel like there's too much benefit for using FileDialog even if copy / paste doesn't work. That said, the fact that you are unknowingly modifying the sketch code while attempting to copy / paste into the dialog is pretty bad.

@sampottinger
Copy link
Collaborator Author

Ugh. I looked into this including a series of abandoned 3rd party libs. It doesn't look like there's an easy alternative. :(

@sampottinger
Copy link
Collaborator Author

Yay great news! Vaqua might work.

@sampottinger sampottinger changed the title Switch to JFileChooser on Mac per #77. Switch to JFileChooser on Mac with VAqua Apr 20, 2020
@sampottinger
Copy link
Collaborator Author

Yay Vaqua works! This is good to go!

@sampottinger
Copy link
Collaborator Author

Sorry continuous integration on my side caught a missing jar.

@sampottinger
Copy link
Collaborator Author

Should be fixed now.

@sampottinger
Copy link
Collaborator Author

Hey there! There's a few PRs outstanding (with inter-dependencies) and the build on master has been broken on Mac for some time. So, I have an integration branch over at https://github.com/sampottinger/processing4 master. That branch includes this PR. This allows one to use Processing 4 again on a Mac along with all of the recent bug fixes. For your convenience, I have made builds available at https://www.datadrivenempathy.com/processing.

@clankill3r
Copy link

Using VAqua will bump the minimum requirement for processing to OSX 10.10, I don't know if this is a problem, but something to be aware of.

@sampottinger
Copy link
Collaborator Author

Good call @clankill3r. I am adding in a version guard. Everything is API compatible so, if Vaqua isn't available because OS X is too old, it will just revert to the regular OS X swing behavior (with the bad JFileChooser).

Responded to @clankill3r's feedback, adding a OS X version gaurd before vaqua is enabled.
build/build.xml Outdated Show resolved Hide resolved
@sampottinger
Copy link
Collaborator Author

Thanks so much @benfry! Just made some updates below. Thanks!

Min mac version
Resolved with Info.plist.

Download Jar
I switched this out so that it downloads from vaqua's site. However, I re-encountered an issue I had forgotten about. There's extraneous output that comes from vaqua on some macs when opening the save dialog as shown:

Screen Shot 2020-04-27 at 5 43 00 PM

The message is not useful and it's not an error. I rebuilt the jar without that message but it does mean it's a custom jar. LMK how you want to proceed.

Preferences
I resolved all the questions except for how to represent this in the preferences. LMK how you want to proceed. I currently have a draft proposal in here with the following defaults:

# Default to the native (AWT) file selector where possible
chooser.files.native = true
chooser.files.native.macosx = false # except on mac where it's broken

Plus the addition of editor.allow_vaqua which defaults to true.

@sampottinger
Copy link
Collaborator Author

This is available on an integration branch at https://github.com/sampottinger/processing4 (master) for testing in the context of other open PRs with a community build at https://www.datadrivenempathy.com/processing.

@benfry benfry merged commit 75265fd into master Aug 15, 2020
@benfry benfry deleted the fix_mac_os_save branch August 15, 2020 12:47
@benfry
Copy link
Owner

benfry commented Aug 15, 2020

Is the custom build thing solved by doing checkout/patch/build as part of the build process? Can that be done with a couple lines in build.xml or is it more complex than that?

Opting to merge, though a little nervous about no new releases since February 2019 (i.e. no Catalina release, and this debug message still embedded.) Didn't see a link to a source repo to see if there's any development version or sign of commits.

@sampottinger sampottinger restored the fix_mac_os_save branch August 17, 2020 04:30
@clankill3r
Copy link

I appreciate the hard work but I think this is a case of over engineering.
While command+c command+v now works it comes at the cost of:

  • having no search field
  • having no recent locations
  • no Favourites or Locations (so a USB stick has to be accessed by going to Mac/Volumes for example)
  • no "Show items as" or "Group items by"
  • thick font rendering

@benfry
Copy link
Owner

benfry commented Apr 29, 2021

This has since been reverted, and alpha 4 is not using VAqua. Please use a new issue if there's a problem.

Repository owner locked and limited conversation to collaborators Apr 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mac Dark Mode cut/copy/paste while saving a sketch on OS X goes to the editor, not the save dialog
3 participants