Skip to content

Switch to JFileChooser on Mac with VAqua#88

Merged
benfry merged 17 commits into
masterfrom
fix_mac_os_save
Aug 15, 2020
Merged

Switch to JFileChooser on Mac with VAqua#88
benfry merged 17 commits into
masterfrom
fix_mac_os_save

Conversation

@sampottinger

@sampottinger sampottinger commented Apr 18, 2020

Copy link
Copy Markdown
Collaborator

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 sampottinger requested a review from benfry April 18, 2020 23:58
@sampottinger

sampottinger commented Apr 19, 2020

Copy link
Copy Markdown
Collaborator Author

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Collaborator Author

Yay Vaqua works! This is good to go!

@sampottinger

Copy link
Copy Markdown
Collaborator Author

Sorry continuous integration on my side caught a missing jar.

@sampottinger

Copy link
Copy Markdown
Collaborator Author

Should be fixed now.

@sampottinger

Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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.
Comment thread app/src/processing/app/Sketch.java Outdated
Comment thread app/src/processing/app/platform/DefaultPlatform.java Outdated
Comment thread build/build.xml Outdated
@sampottinger

Copy link
Copy Markdown
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
Copy Markdown
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

benfry commented Aug 15, 2020

Copy link
Copy Markdown
Owner

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
Copy Markdown

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

benfry commented Apr 29, 2021

Copy link
Copy Markdown
Owner

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