opening files from GUI doesn't work with GtkApplication on OSX
Submitted by dra..@..ey.net
Assigned to gtk-quartz maintainers
I can open a file in my application from the command line:
However, I cannot do the same from the Finder GUI. When I try it that way my application launches but then a popup window appears that says:
The document "foo.csv" could not be opened. MyApp cannot open files in the "csv" format.
I am using GtkApplication but it looks like the quartz implementation is missing the necessary plumbing to handle files opened this way. I can get this working by adding the following code to my app:
AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, NewAEEventHandlerUPP(apple_odoc_handler), 0, false);
This bypasses GtkApplication and my apple_odoc_handler() gets called directly by the OS. I think we need to integrate the above call into gtkapplication-quartz.c so GTK will receive the event and trigger the "open" signal on the GtkApplication instance.