Bug 428559 - Bad ".desktop" file can easily screw up all gtk icons
Summary: Bad ".desktop" file can easily screw up all gtk icons
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Task Manager and Icons-Only Task Manager (show other bugs)
Version: 5.19.5
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Eike Hein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-01 13:10 UTC by Qu Wenruo
Modified: 2023-07-25 00:19 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27.7


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Qu Wenruo 2020-11-01 13:10:41 UTC
SUMMARY
If installing a specific game (*) using steam with proton, proton would create a corrupted desktop file ".desktop" (exactly the name), to corrupt all gtk app icons used in decoration and "big icon" alt-tab switcher.

The offending game is https://store.steampowered.com/app/1372300/Iwaihime/

But since the cause the ".desktop" in .local/share/applications, it doesn't need the game to do the trick.

STEPS TO REPRODUCE
1. Create file ".local/share/applications/.desktop" with whatever icon you like
2. Check the icon of the window decoration of any running gtk applications 
3. Check the icon of "big icon" alt-tab window

OBSERVED RESULT
Most GTK applications get wrong icon from the ".desktop" file.


EXPECTED RESULT
GTK applications still follow their original icon.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch
KDE Plasma Version: 5.20.2
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.1

ADDITIONAL INFORMATION
Maybe it's a bug in gtk icon cache? But strangely I only found the following icons get affects:
- GTK app icons in window decoration (if enabled)
- GTK app icons in big/small icon alt-tab task switcher

QT applications like konsole, dolphin doesn't get affected.

And of course, with that ".desktop" file renamed, everything comes back to normal.
Comment 1 Justin Zobel 2020-11-01 23:55:13 UTC
It sounds like the issue to me is the bad .desktop file that Steam are providing, not a KDE issue. Perhaps they need to call the desktop file asterisk.desktop.
Comment 2 Qu Wenruo 2020-11-02 00:18:30 UTC
Yes, steam is the cause, but the problem is, shouldn't KDE be robust enough to detect such malfunctioning desktop file and don't allow it to corrupt other app's icon?
Comment 3 Justin Zobel 2020-11-02 00:20:45 UTC
True I guess this could be solidified more to verify a .desktop file is within spec and if not, ignore it completely.
Comment 4 Qu Wenruo 2020-11-02 00:28:39 UTC
I guess that's the correct way to go.

Although the only invalid part is the file name. ".desktop".
Everything else is pretty OK, and I'm not sure if the name ".desktop" really breaks any spec though.
Comment 5 Nicolas Fella 2020-11-02 10:02:10 UTC
I would guess this has to do with how libtaskmanager resolves/guesses the desktop entry for a window, but I haven't looked closer
Comment 6 Fushan Wen 2023-03-17 16:45:44 UTC
Cannot reproduce in 5.27
Comment 7 Fushan Wen 2023-07-24 23:59:32 UTC
Git commit 506fd06e5d07717bd0b52bdfc5970b181454228f by Fushan Wen.
Committed on 25/07/2023 at 01:43.
Pushed by fusionfuture into branch 'master'.

libtaskmanager: skip empty appId when matching '*.appId.desktop'

When appId is empty, "*..desktop" can be a match. Some games like Touhou
tend to add an extra dot at the end of the desktop name, which causes
Marisa to exist everywhere.
Related: bug 472576
FIXED-IN: 5.27.7

A  +8    -0    libtaskmanager/autotests/data/applications/marisa..desktop
M  +3    -0    libtaskmanager/autotests/tasktoolstest.cpp
M  +1    -1    libtaskmanager/tasktools.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/506fd06e5d07717bd0b52bdfc5970b181454228f
Comment 8 Fushan Wen 2023-07-25 00:19:37 UTC
Git commit 5b59a1334c92d3edaf44b774df3fa608016913e8 by Fushan Wen.
Committed on 25/07/2023 at 02:08.
Pushed by fusionfuture into branch 'Plasma/5.27'.

libtaskmanager: skip empty appId when matching '*.appId.desktop'

When appId is empty, "*..desktop" can be a match. Some games like Touhou
tend to add an extra dot at the end of the desktop name, which causes
Marisa to exist everywhere.
Related: bug 472576
FIXED-IN: 5.27.7


(cherry picked from commit 506fd06e5d07717bd0b52bdfc5970b181454228f)

A  +8    -0    libtaskmanager/autotests/data/applications/marisa..desktop
M  +3    -0    libtaskmanager/autotests/tasktoolstest.cpp
M  +1    -1    libtaskmanager/tasktools.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/5b59a1334c92d3edaf44b774df3fa608016913e8