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
chromium: fix .desktop file name #23518
Conversation
The desktop file must be name "chromium-browser.desktop" because it is used as-is when setting chromium as the default browser. See https://cs.chromium.org/chromium/src/chrome/browser/shell_integration_linux.cc?l=657&rcl=34b92857a547538555be6a38e95f7e95ab9b6842
@layus, thanks for your PR! By analyzing the history of the files in this pull request, we identified @jraygauthier, @aszlig and @obadz to be potential reviewers. |
@layus: Does work for you? After rebuilding my system with this PR, I still get the "Chromium isn't your default browser. [Set as default]" popup. I click "[Set as default]" and the message is still shown the next time I start chromium. I restarted my machine after doing the first "nixos-rebuild boot" with this PR, and I checked / updated all nix-env packages. |
There seems to be an issue indeed. It only partially works. Investigating. (handlers are set properly, but not the default browser) |
It seems that xdg-mime is somehow broken. Reading and writing does not use the same file !
|
And indeed the fix we need is at https://cgit.freedesktop.org/xdg/xdg-utils/commit/scripts/xdg-mime.in?id=9dac27a442b0e44b3f235798b77715e26169500f. |
It's amazing how fixes like that can sit in a development branch and not get released for so long. I've asked upstream to make a release: https://lists.freedesktop.org/archives/portland/2017-March/001193.html |
fc1eed0
to
fbdbe93
Compare
Building from git because we need a patch for chromium.
fbdbe93
to
179d201
Compare
@globin This is ready for 17.03, but better merge this soon, because it updates xdg-utils. This is a small mass-rebuild ;-). |
Testing. |
@domenkozar Testing this together with the fix for firefox is interesting. You can alternate between both as default ;-). |
I couldn't reproduce the problem anymore even before testing this. I can share chromium closure if someone wants :) |
@domenkozar Yes, please share it :-). Have you tried Also, note that chromium does not always ask to be the default browser. You neet to go into the options and check there the default status. |
Chromium in this PR is out of date with master, so it reports it can not load the profile. It still reports in settings that it's not the default browser. |
|
@domenkozar Something went wrong then, because setting chromium as default browser should make You need to set this chromium as the default browser before it can report being the default one. Chromium has never recognised chromium.desktop as itself. |
What's holding up this merge? Is any further testing required? |
@layus I might have tested this wrong, as it seems I need to install chromium into my profile so the desktop file gets propagated correctly. Did someone test this and confirm it works? |
Yes, it only works if chromium is installed in the profile. Otherwise it cannot find chromium-browser.desktop and fails to set it as the default. |
Seems like an obvious fix. Our xdg-utils version is |
The desktop file must be name "chromium-browser.desktop" because it is used as-is when setting chromium as the default browser. See https://cs.chromium.org/chromium/src/chrome/browser/shell_integration_linux.cc?l=657&rcl=34b92857a547538555be6a38e95f7e95ab9b6842 fixes #23518 (cherry picked from commit c7f00e3)
I just updated from |
AFAIK so far the menu updates require a logout to take effect. |
I rebooted already, as part of applying the update. |
I hope, I did not break chromium's icon on stable. I'll test our hydra's build in the evening ... |
@jerith666 I would be glad to get more insights from your side. I am not too familiar with KDE, but there should be an actual file describing the content of the launcher. Could you dig into the issue and find why it looks for /run/current-system/sw/share/applications/chromium.desktop ? Could you in particular look into |
|
here are two other hits, may be more relevant. I don't have GUI access to the machine in question right now though, just SSH, so can't test extensively:
|
I did a recursive grep of all my dot directories and files ( |
@jerith666 You can safely remove all the references to userapp-Nightly... in ~/.config/mimeapps.list. These are old entries inserted by firefox. The If deleting the line does not remove the shortcut, we will have to look elsewhere for its definition. |
I removed the shortcut, confirmed no hits for
I also confirmed that the Chromium menu item on the KDE "start" menu is still failing. Specifically, clicking it produces these dialogs: Still can't find anyplace that's storing this old shortcut name. :( (In the meantime, I've just locally reverted c7f00e3.) |
@jerith666 I have tried a fresh vm with https://gist.github.com/layus/f5ad459f5a4e13be93fe8d86b51d46b7. I am unable to reproduce your bug, and everything works well. In particular, when I made a shortcut to chromium, it was a shortcut to /run/current-system/.../chromium-browser.desktop and it launched chromium correctly. You could check that you do have the fix in your channel, and that you are using the right chromium (it may be installed only for your user, or only for the system). I last resort, you may find some kde/plasma gurus on irc. I wish I could be more useful, but this is as far as I can go concerning plasma :-/. |
I couldn't reproduce it either. I admit, that this change should have gone in before stable release, due to the potential breakage. I does fix a long-standing annoyance of NixOS, though, and since there aren't more reports on this, I'm leaving it in. |
Thanks for checking into it, both of you -- it's about as far as my understanding goes WRT plasma too. :) I agree it doesn't need to be reverted in nixpkgs. I think I'm just going to keep my revert locally, and leave this thread here for any others who might run into this issue. |
The desktop file must be name "chromium-browser.desktop" because it is
used as-is when setting chromium as the default browser.
See https://cs.chromium.org/chromium/src/chrome/browser/shell_integration_linux.cc?l=657&rcl=34b92857a547538555be6a38e95f7e95ab9b6842
Fixes #4370 for chromium.
/cc @domenkozar for #4370 (comment)