Bug 468129 - Be smarter about finding the app icon like Plasmashell does for apps that set their desktop files incorrectly
Summary: Be smarter about finding the app icon like Plasmashell does for apps that set...
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: core (other bugs)
Version First Reported In: 5.27.3
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-03 20:05 UTC by Wyatt Childers
Modified: 2025-06-17 22:17 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wyatt Childers 2023-04-03 20:05:48 UTC
SUMMARY
The flatpak icon is displayed incorrectly on window frames (however it's displayed correctly in the Plasma Shell Task Manager widgets.

STEPS TO REPRODUCE
1. Install a flatpak like Rhythmbox
2. Open Rhythmbox

OBSERVED RESULT
Plasma Shell's Task Manager widget shows the Rhythmbox icon.

EXPECTED RESULT
The Rhythmbox window shows a generic Wayland application icon.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 37
KDE Plasma Version: 5.27.3
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8
Kernel Version: 6.2.8-200.fc37.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 32 × AMD Ryzen 9 7950X 16-Core Processor
Memory: 61.9 GiB of RAM
Graphics Processor: AMD Radeon RX 6700 XT
Manufacturer: ASUS

ADDITIONAL INFORMATION
This also happens with things like Slack or Discord, except they display the generic X11 application icon.
Comment 1 Nate Graham 2023-04-03 21:50:00 UTC
On Wayland, these are unfortunately application bugs. You'll need to report them to the apps themselves.
Comment 2 Wyatt Childers 2023-04-03 22:05:39 UTC
(In reply to Nate Graham from comment #1)
> On Wayland, these are unfortunately application bugs. You'll need to report
> them to the apps themselves.

Perhaps this is an ideological stance on the Kwin side, but it seems quite contrary to what seems like "common sense" (i.e., that if Plasma can figure out the application icon, Kwin could figure out the icon)?
Comment 3 Nate Graham 2023-04-03 22:08:47 UTC
The issue is that KWin is a window manager and gets its window icons from the window. So the window has to *have* an icon for KWin to display. The Task Manager, on the other hand looks in the app's desktop file to get the icon. KWin theoretically could do this too, so you're not wrong that it's an ideological stance on the part of the KWin developers. The thing is, always using the .desktop file icon would mean that if the window did set its own icon, KWin would discard it, ignoring the wishes of the developer. KWin could do it only when the window doesn't set its own window icon, maybe. But this could seem random to the user.
Comment 4 Wyatt Childers 2023-04-03 22:13:14 UTC
(In reply to Nate Graham from comment #3)
> The issue is that KWin is a window manager and gets its window icons from
> the window. So the window has to *have* an icon for KWin to display. The
> Task Manager, on the other hand looks in the app's desktop file to get the
> icon. KWin theoretically could do this too, so you're not wrong that it's an
> ideological stance on the part of the KWin developers. The thing is, always
> using the .desktop file icon would mean that if the window did set its own
> icon, KWin would discard it, ignoring the wishes of the developer. KWin
> could do it only when the window doesn't set its own window icon, maybe. But
> this could seem random to the user.

I think it would be completely sensible to fallback to the desktop file when the application has not set an icon. 

If a window sets an icon that's great, and sure it should be used. However, if a window fails to set an icon, I think it's far more shocking that a "wayland" or "x11" icon is used, meanwhile KDE (as a whole) clearly sees a much more optimal answer provided by the desktop file.

i.e., I'd argue the rule should be:
1. Use what the window set
2. Use what the desktop set
3. Use a fallback icon for Wayland/X11 (as a last resort)

#2 is always going to be far more user relevant than #3. In terms of UX, I think the most compelling use case is that, as it stands, if this bug is exhibited by a handful of currently open applications the icon only task switcher is rendered borderline useless.
Comment 5 Nate Graham 2023-04-03 22:15:04 UTC
Yes, that seems reasonable to me.
Comment 6 Nicolas Fella 2023-04-03 22:26:47 UTC
Nate, I'm afraid you are mistaken.

On Wayland there is no concept of a window icon. The icon you see for Wayland apps *always* comes from the desktop file. Now why are some icons missing? This happens when the desktop file name reported by the app doesn't match the actual desktop file on disk. Plasma has some extra code that tries to fix up these broken apps that kwin doesn't have, which is why some apps have icons in Plasma but not in KWin
Comment 7 Wyatt Childers 2023-04-03 22:35:04 UTC
(In reply to Nicolas Fella from comment #6)
> Nate, I'm afraid you are mistaken.
> 
> On Wayland there is no concept of a window icon. The icon you see for
> Wayland apps *always* comes from the desktop file. Now why are some icons
> missing? This happens when the desktop file name reported by the app doesn't
> match the actual desktop file on disk. Plasma has some extra code that tries
> to fix up these broken apps that kwin doesn't have, which is why some apps
> have icons in Plasma but not in KWin

Perhaps that logic could be moved into one of the KDE frameworks, and then shared between Plasma and Kwin so things are always consistent?
Comment 8 Nate Graham 2023-04-03 22:50:44 UTC
Urp, my bad. I'll try to remember that.

Indeed, moving that logic to a central place so KWin can use it too seems like a good idea.
Comment 9 TraceyC 2025-06-17 22:17:32 UTC
Moving so the kwin developers can consider this