Bug 402587 - Snap apps pinned to Task Manager get executed by their path, not the exec line of their .desktop file
Summary: Snap apps pinned to Task Manager get executed by their path, not the exec lin...
Status: RESOLVED WORKSFORME
Alias: None
Product: plasmashell
Classification: Plasma
Component: Task Manager and Icons-Only Task Manager (show other bugs)
Version: 5.14.3
Platform: Debian testing Linux
: NOR normal
Target Milestone: 1.0
Assignee: Eike Hein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-26 16:53 UTC by Erfan Tabatabaei
Modified: 2022-03-01 04:36 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erfan Tabatabaei 2018-12-26 16:53:16 UTC
- Description 

I installed Firefox snap package, and opened it from the menu and right clicked in its icon in the Task manager and pinned it. Then I closed it, and opened it again; this time by clicking on its icon in the Task Manager. The "first-run" window showed up again, and Firefox was using the system theme. I checked, and it indeed was using the $HOME/.mozilla directory rather than $HOME/snap/firefox/common/.mozilla directory. It does not happen when launching Firefox from the menu. The same is true for Chromium snap package. Same thing happens when using Icons-only Task Manager. I tested in Debian Buster and openSUSE Tumbleweed, both produce the same results. This does not happen in GNOME desktop.

Another problem with this approach is that when snapd updates Firefox, launching it from the Task Manager opens the old version, not the updated one, unless unpinned and pinned again.

- STEPS TO REPRODUCE
1. Install Firefox snap package
2. Open Firefox snap package from the menu
3. Right click on the icon in the Task Manager and click on Pin
4. Close Firefox
5. Open Firefox again, this time by clicking on its icon in the Task Manager

- OBSERVED RESULT
Firefox uses $HOME/.mozilla instead of $HOME/snap/firefox/common/.mozilla to store user profiles.

- EXPECTED RESULT
Firefox should use $HOME/snap/firefox/common/.mozilla to store user profiles.

- SOFTWARE/OS VERSIONS
Distribution: Debian Buster, openSUSE Tumbleweed
KDE Plasma Version: 5.14.3, 5.14.4
KDE Frameworks Version: 5.51.0, 5.53.0
Qt Version: 5.11.2, 5.12.0
Comment 1 David Edmundson 2018-12-26 23:28:19 UTC
At a plasma level we just run whatever is in the Exec line of the .desktop file.

Your bug isn't in any code we control, sorry
Comment 2 Erfan Tabatabaei 2018-12-26 23:40:36 UTC
(In reply to David Edmundson from comment #1)
> At a plasma level we just run whatever is in the Exec line of the .desktop
> file.
> 
> Your bug isn't in any code we control, sorry

This is interesting actually. I tried launching it from a laucnher on the desktop and the problem does not show up then. It seems that if it launches according to the .desktop file, all goes well. But pinning it may do a modification to the .desktop file. Perhaps it removes the beginning "env ..." line?
Comment 3 David Edmundson 2018-12-26 23:48:31 UTC
Right click -> "edit applications" should show you.

If you do find some info that suggests we're breaking the .desktop file please do reopen this with the newfound information.
Comment 4 Erfan Tabatabaei 2018-12-27 02:42:36 UTC
(In reply to David Edmundson from comment #3)
> Right click -> "edit applications" should show you.
> 
> If you do find some info that suggests we're breaking the .desktop file
> please do reopen this with the newfound information.

Found the problem. It seems that when pinning Firefox, Task Manager is not using the .desktop file at all. It is using the /snap/firefox/159/firefox binary instead. I also installed opera-developer snap and pinned it. Task Manager correctly pins .desktop file for opera-developer, but not for Firefox.
Comment 5 Erfan Tabatabaei 2018-12-27 13:49:50 UTC
It's in the $HOME/.config/plasma-org.kde.plasma.desktop-appletsrc file. It contains a lot of gibberish, but here is a summarized one without all the extra bits. I also uploaded a full version of the file at https://pastebin.com/t9zkxteC.

plasma-org.kde.plasma.desktop-appletsrc:launchers=applications:org.kde.dolphin.desktop,applications:opera-developer_opera-developer.desktop?iconData=[CUT],file:///snap/firefox/159/firefox?iconData=[CUT],applications:chromium.desktop,applications:com.discordapp.Discord.desktop,applications:steam.desktop,applications:qbittorrent.desktop,applications:lutris.desktop,applications:q4wine.desktop,file:///usr/bin/gimp-2.10?iconData=[CUT],applications:obs.desktop,applications:org.kde.kdenlive.desktop,file:///usr/bin/ghb?iconData=[CUT],applications:org.kde.kate.desktop,applications:virtualbox.desktop,applications:systemsettings.desktop,applications:org.kde.konsole.desktop
Comment 6 Nate Graham 2019-01-01 01:19:14 UTC
> file:///snap/firefox/159/firefox
Looks like the task manager is getting confused by the fact that Snaps are mounted.

Out of curiosity, do you see any difference between:
- Pinning the Snap Firefox when it's currently running
- Pinning the Snap Firefox when it's not running
Comment 7 Erfan Tabatabaei 2019-01-03 00:32:25 UTC
(In reply to Nate Graham from comment #6)
> Out of curiosity, do you see any difference between:
> - Pinning the Snap Firefox when it's currently running
> - Pinning the Snap Firefox when it's not running

Yes. Pinning it from the application menu pins the .desktop file. But launching it leads to another firefox icon appearing in the Task Manager, which is the binary.
Comment 8 Nate Graham 2019-01-07 02:40:40 UTC
Thanks for the information!
Comment 9 galder 2022-01-30 15:46:45 UTC
Looks like an old issue. Setting it to needs more info.
Please try with a newer version(plasma 5.23.5) and if this is not an issue any more let us know.
Bugs placed into NEEDSINFO status will receive a reminder if the ticket:

    Is at least 15 days old
    Has not received any comment within 15 days

If a bug remains in NEEDSINFO for another 15 days with no comment, it will be closed as RESOLVED > WORKSFORME.
If a bug remains in NEEDSINFO with a comment provided within less than 15 days, no action will be taken (as it does not meet the above criteria).
Comment 10 Bug Janitor Service 2022-02-14 04:36:28 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 11 Bug Janitor Service 2022-03-01 04:36:40 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!