-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Add URL handler support for Linux desktops #56727
Conversation
Oh man, going down the rabbit hole here. While this is a good step, it's not enough: This is still needed: https://github.com/Microsoft/vscode/blob/4318f34e285009339998fd1382de93e1f58c1fa2/src/vs/platform/url/electron-main/electronUrlListener.ts#L43 But it always returns Which resolves to the Which is set on the Electron app: https://github.com/electron/electron/blob/f8828aa804508e4987db6fe249c55b1a51add969/atom/browser/api/atom_api_app.cc#L862 And this is the wrong Wow. Electron needs some documentation here, that took too long to figure out. I'll pick this PR up, clean it, get these findings in there and merge it tomorrow. |
I think The behavior of |
We still need a valid Yeah, absolutely, once I'm done I'll file an issue to improve the docs there. |
Hmm so It's one main command line that can be associated with MIME types per desktop file, as far as I know. What the desktop name variable in electron should point might also be an issue, since I'm not sure what more it might be used for besides |
As expected, we still needed a secondary hidden Thanks for this push, great job! 🍻 Do you mind testing it in tomorrow's release? A good URL example is: |
Type=Application | ||
NoDisplay=true | ||
StartupNotify=true | ||
StartupWMClass=@@NAME_SHORT@@ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm for some reason unable to find documentation on the logic Gnome and other desktop environments use to group windows. I guess it uses the WM_CLASS
, and it groups it to the URL handler desktop despite it being NoDisplay
... Guess removing StartupWMClass
makes sense? Why not go ahead and make a PR?
This works by adding a
NoDisplay
desktop file that registers for the MIME typex-scheme-handler/vscode
to the deb and rpm package.I added a
URL Handler
suffix to the name in that desktop file so it's discernible in menu editors from the main desktop file. It will appear like that in the UI in some places though.See: Desktop Entry Specification - Recognized desktop entry keys, shared-mime-info-spec - URI scheme handlers
Fixes #48528
P.S. I wonder if
desktop-file-install
is really needed... I think the database is updated automatically when installing a desktop file from a deb.