Replies: 1 comment 2 replies
-
I don't have direct knowledge. I'm still using [gtk-mac-integration[(https://gitlab.gnome.org/GNOME/gtk-mac-integration), which does handle the open file notification. Grepping |
Beta Was this translation helpful? Give feedback.
-
I'm struggling to get my (C++) Gtk 3 app (built around GtkApplication/GApplication and bundled via gtk-mac-bundler) to open documents via double click in MacOS Finder (or alternatively via
open doc.myExt
oropen -a MyApp.app doc.myExt
from the terminal). Any of those will raise an error message likeand then launch
myApp
(via the activate signal handler of my GApplication).My understanding is that Finder and the open command use Launch Services to identify the preferred app and to actually open a document in the preferred app (if not explicitely stated in the
open
command), and Launch Services sends an Apple Event to the app that should open the document. I assume that the GApplication receives that Apple Event and calls its "open" signal handler, passing the list of files to be opened.For associating the app bundle with the file extension (say myExt) I use a block like
This appears to work in so far as the double click in Finder or the
open doc.myExt
opensmyApp
(and not a different app). Also when I use the--args
option in theopen
command to pass the file nameor simply run
it works fine (and uses the
open
signal handler). So I'm really wondering what goes wrong here and if GApplication/Gtk3 really support this feature.Any help would be appreciated. If I should provide a minimal example, let me know.
Beta Was this translation helpful? Give feedback.
All reactions