-
Notifications
You must be signed in to change notification settings - Fork 44
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
Using CFBundleDocumentTypes breaks Spyder application #179
Comments
macOS file type association is a bit special. When you launch an application through an associated document, the OS triggers an event which the registered app must be able to listen to. In contrast, in Linux and Windows, the kernel simply launches What we have done here is to implement a simple universal listener that will take the OS event and pass it to the handler via the designated command. In other words, you need |
I still don't understand why this is necessary. Following is a screencast illustrating that file associations work just fine with only the specifications in This shows
|
Hm, when I was researching this I couldn't get it to work. Then @aganders3 gave us a hand with the listener/launcher. Is Spyder registering a special listening method in Qt? What version of macOS is this? Which Qt? I think we can change the logic to inject the launcher (e.g. only when |
Hm, I'm super interested. I thought maybe this could be done with Qt and/or pyobjc but I couldn't figure it out at the time. It would be great to not need this hack. Edit: just peeked at the Spyder source. Maybe it's because Spyder uses itself as both the listener and handler? Ah no there's some more customization here I need to understand |
This is probably a reasonable way to do it, and would just need to document its then on the app itself to listen for the macOS events. |
Yea, it looks like you are using |
What I think may actually be going on is that this issue was resolved when we added the Python symbolic link to the app bundle, i.e. |
Agreed.
I don't believe so. See my previous comments about
There is nothing magical going on here. We do handle |
Thanks for the extra context. I'm not very familiar with Spyder but will take a closer look. I'm happy to arrange some time with either/both of you to chat live as well. |
Okay I think I understand a bit more now. Qt is definitely doing whatever needs to be done here, and the only thing Spyder is doing is subclassing Still I think the appkit-launcher we have may be useful for certain circumstances. Basically it would let you write a Python app without Qt and without importing any pyobjc stuff. I'm not sure how common that might be. I'm even less familiar with other GUI toolkits so not sure if they can similarly translate the macOS file open events. If it's not useful we can just toss that separate launcher and the corresponding logic for the nested app bundle. Anyway for now let's try #183 (though I haven't looked closely at it) to see if that at least gets Spyder working. |
The PR is ready for review. Let me know if it works or if the docs are clear! Thanks 🙏 |
Note: this results in a non-functioning application bundle, with nested application and broken executable stubs (conda/menuinst#179)
Note: this results in a non-functioning application bundle, with nested application and broken executable stubs (conda/menuinst#179)
Note: this results in a non-functioning application bundle, with nested application and broken executable stubs (conda/menuinst#179)
Note: this results in a non-functioning application bundle, with nested application and broken executable stubs (conda/menuinst#179)
Note: this results in a non-functioning application bundle, with nested application and broken executable stubs (conda/menuinst#179)
Note: this results in a non-functioning application bundle, with nested application and broken executable stubs (conda/menuinst#179)
Note: this results in a non-functioning application bundle, with nested application and broken executable stubs (conda/menuinst#179)
Checklist
What happened?
When using
CFBundleDocumentTypes
for theosx
platform for Spyder, theinfo.plist
file is created correctly, but the application bundle does not launch. The resulting bundle structure is as follows:For Spyder, I don't believe that the sub application in Resources is necessary. If I omit
CFBundleDocumentTypes
from the json file, but later manually update theinfo.plist
file, then Spyder launches and behaves as expected.spyder-menu.json
Conda Info
Conda Config
Conda list
Additional Context
No response
The text was updated successfully, but these errors were encountered: