Open mihe opened 3 months ago
After checking with @bruvzg it seems that the more appropriate fix for this would be to:
*.app
folders) as well, possibly through a new property.OS
method, which on macOS would use the NSWorkspace
method openURLs:withApplicationAtURL
instead.I'm assuming the change to the file picker should still allow for navigating into the bundle in some way, when necessary, similar to the "Show Package Contents" context action in Finder.
I agree that NSWorkspace
is definitely the way to go with all interactions like this where you want to open files in other applications.
- Change Godot's file picker to be able to pick bundles (e.g.
*.app
folders) as well, possibly through a new property.
Regarding the picking of bundles this might be easier to implement via the native file pickers, for example on macOS where these will show and allow .app bundles to be selected as files rather than folders. Similarly other native file pickers might have appropriate modes where you can select applications in the formats they have on that platform.
Regarding the picking of bundles this might be easier to implement via the native file pickers
Using the native file pickers is already a thing through the interface/editor/use_native_file_dialogs
editor setting (which is disabled by default) so support for this would likely need to be added to Godot's own file picker anyway.
Tested versions
Reproducible in: 4.3.beta [ec02d406ca0b9c822addff49cf58e9a72cf74eb0]
System information
macOS 13.6.7
Issue description
When trying to use the
filesystem/external_programs/*
editor settings on macOS, like for examplefilesystem/external_programs/raster_image_editor
, there are several issues currently:*.app
) (generally located in/Applications
) making you have to dig through the*.app
folder to look for the relevant binary, of which there may be several.*.app
folder, for example/Applications/Adobe Photoshop 2024/Adobe Photoshop 2024.app
, it'll open Photoshop when executing the "Open in External Program" action in the FileSystem dock, but it won't actually open the desired file within Photoshop. This is true even if you point the setting to the actual binary within the*.app
folder as well.Note that the second problem doesn't manifest with all applications. Things seem to work fine with Krita for example, but not with Photoshop.
Either way, I believe the idiomatic way of opening applications like this on macOS is using/usr/bin/open
(which seems to work fine) as opposed to the traditional Unix-style invocation.It seems to me that the following changes need to be made:Change these settings to usePROPERTY_HINT_GLOBAL_DIR
on macOS.Ideally have the dialog open in/Applications
right away, if possible.Open the application usingopen /Applications/Some.app --args /Path/To/File
rather than/Applications/Some.app /Path/To/File
.Also note that just using "Open in External Program" without having these settings assigned works fine, as that goes through
OS_MacOS::shell_open
rather thanOS_Unix::create_process
, but that requires having assigned the program as the default in macOS, which may not be desirable.Steps to reproduce
/Applications/Adobe Photoshop 2024/Adobe Photoshop 2024.app
).Minimal reproduction project (MRP)
N/A