Bug 418996

Summary: Dark Telegram icon on dark Breeze theme
Product: [Plasma] Breeze Reporter: Jakub <jakubmadej.pl+kde>
Component: IconsAssignee: visual-design
Status: RESOLVED FIXED    
Severity: normal CC: alberto, aria, artem.anufrij, bugseforuns, david.decos, fljustsocial, jan.rathmann, kainz.a, KDE, ken20001, lagru+kde, mcder3, meven29, nate, yanp.bugz, zawertun
Priority: HI    
Version: 5.25.5   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.24.6
Attachments: Screenshot

Description Jakub 2020-03-18 18:14:28 UTC
SUMMARY
Dark icon in system tray on Breeze Dark theme in KDE Plasma

STEPS TO REPRODUCE
1. Open Telegram Desktop

OBSERVED RESULT
A dark icon appears in the system tray

EXPECTED RESULT
The icon should be light in the system tray

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: archlinux
(available in About System)
KDE Plasma Version: 5.18.3
KDE Frameworks Version: 5.68.0
Qt Version: 5.14.1

ADDITIONAL INFORMATION
Comment 1 Jakub 2020-03-18 18:17:31 UTC
Created attachment 126877 [details]
Screenshot

Telegram icon hard to see
Comment 2 Nate Graham 2020-03-18 19:13:10 UTC
Yeah, we had to revert this change since there's an incompatibility in Telegram itself. :/
Comment 3 Nate Graham 2020-03-23 02:15:46 UTC
*** Bug 419129 has been marked as a duplicate of this bug. ***
Comment 4 David Hurka 2020-03-27 20:51:48 UTC
*** Bug 419311 has been marked as a duplicate of this bug. ***
Comment 5 Nate Graham 2020-04-06 14:27:52 UTC
*** Bug 419717 has been marked as a duplicate of this bug. ***
Comment 6 mcder3 2020-04-21 02:51:32 UTC
(In reply to Nate Graham from comment #2)
> Yeah, we had to revert this change since there's an incompatibility in
> Telegram itself. :/

I don't know if it would be possible for such an icon to be managed by the plasma theme instead of the breeze icon pack.

Like giving it a color change function like the system.svg icons in the plasma breeze theme.
Comment 7 Azarilh 2020-04-26 03:17:45 UTC
You can personally solve this by substituting the dark icons with the light ones.

sudo cp /usr/share/icons/breeze-dark/status/22/telegram* /usr/share/icons/breeze/status/22
sudo cp /usr/share/icons/breeze-dark/status/24/telegram* /usr/share/icons/breeze/status/24/
Comment 8 Azarilh 2020-04-26 03:19:29 UTC
Of course remember to make a backup first.
Comment 9 daniel 2020-04-27 06:18:57 UTC
the fix commit was remove the breeze-icons for telegram. 
So if you dont want wait the update then remove/rename this files and the original telegram icon will back.

/usr/share/icons/breeze/status/22/telegram-panel.svg
/usr/share/icons/breeze/status/22/telegram-attention-panel.svg
/usr/share/icons/breeze/status/22/telegram-mute-panel.svg

/usr/share/icons/breeze/status/24/telegram-panel.svg
/usr/share/icons/breeze/status/24/telegram-attention-panel.svg
/usr/share/icons/breeze/status/24/telegram-mute-panel.svg

https://github.com/KDE/breeze-icons/commit/309ea93012f3fe990625419bcca9c11915ebc8ad
Comment 10 Nate Graham 2021-01-11 06:10:27 UTC
*** Bug 431387 has been marked as a duplicate of this bug. ***
Comment 11 David de Cos 2021-02-16 15:32:59 UTC
I just got this bug again, after installing Frameworks 5.79.0. Breeze Dark theme gets its Telegram system tray icons from Breeze, resulting in them being almost invisible.
Comment 12 Michal Kec (MiK) 2021-02-19 19:16:27 UTC
I can confirm this bug with Plasma 5.21 and Breeze Twilight.

Operating System: KDE neon 5.21
KDE Plasma Version: 5.21.0
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2
Kernel Version: 5.11.0-051100-generic
OS Type: 64-bit
Graphics Platform: X11
Comment 13 Patrick Silva 2021-06-16 00:12:51 UTC
I can't reproduce with Breeze Dark or Breeze Twilight themes on Plasma 5.22.1,
Frameworks 5.83. Can anyone?
Comment 14 dS810 2021-06-16 07:57:12 UTC
Looks fine on my system. Can't reproduce it.

Operating System: Arch Linux
KDE Plasma Version: 5.22.1
KDE Frameworks Version: 5.83.0
Qt Version: 5.15.2
Kernel Version: 5.12.10-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i5-6300U CPU @ 2.40GHz
Memory: 15.5 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 520
Comment 15 David de Cos 2021-06-16 11:04:50 UTC
I don't know if this can be considered a manifestation of the same bug, but with Oxygen icon theme (+ any variant of Breeze as Plasma theme), the Telegram icon is empty. This worked fine before, but the icon disappeared a few weeks ago, possibly after installing Frameworks 5.82.
Comment 16 Michal Kec (MiK) 2021-07-06 14:02:04 UTC
I can confirm the issue of "empty Telegram icon" with Plasma 5.22, Breeze Twilight theme and Oxygen icons.

Operating System: KDE neon 5.22
KDE Plasma Version: 5.22.2
KDE Frameworks Version: 5.83.0
Qt Version: 5.15.3
Kernel Version: 5.8.0-59-generic (64-bit)
Graphics Platform: X11
Comment 17 Michal Kec (MiK) 2021-12-20 16:13:06 UTC
Possibly related to bug 445518 ?
Comment 18 Jan Rathmann 2022-02-12 16:14:34 UTC
I'm having a dark-on-dark Telegram icon since the update to Plasma 5.24. Both Wayland and X11 session are affected the same. I'm using Telegram as a flatpak (from flathub). 

Distro: Kubuntu 21.10 + Kubuntu-Backports-PPA
Frameworks: 5.90.0
Comment 19 ariasuni 2022-02-13 20:09:12 UTC
Same as Jan, but I’m using the Arch Linux Telegram package instead of Flatpak. I changed my icon theme to breeze-dark and now it works correctly, hopefully it won’t break something else in the process. I was never clear to me what was the difference between the Breeze and the Breeze dark icon themes, or in which case I should use one or the other.
Comment 20 ariasuni 2022-03-15 21:44:27 UTC
> I changed my icon theme to breeze-dark and now it works correctly, hopefully it won’t break something else in the process.

Update: it makes icons in GTK white, which are unreadable with the default light theme, so it did break something in the process.

In the end, I find the most elegant workaround and durable workaround (won’t break after updates to breeze icons): after selecting Breeze-dark in SystemSettings and saving, I edited `$HOME/.gktrc-2.0` and `$HOME/.config/gtkrc-3.0/settings.ini` to replace the value of `gtk-icon-theme-name` from `breeze-dark` to `breeze`.
Comment 21 Yaroslav Sidlovsky 2022-03-19 12:56:00 UTC
I can confirm that this bug exists when using plasma-5.24.3 & KF-5.92.0.
Comment 22 Yaroslav Sidlovsky 2022-03-19 12:59:24 UTC
Nate, could you please add this bug to the list of “15 minute bugs”?
It's definitely affects user experience  in first 15 minutes of KDE usage.
Comment 23 Nate Graham 2022-03-23 19:39:44 UTC
Yeah, agreed.

Not clear who's at fault here though.
Comment 24 Alberto Mattea 2022-03-30 23:50:47 UTC
(In reply to Nate Graham from comment #23)
> Yeah, agreed.
> 
> Not clear who's at fault here though.

The corresponding bug report in telegram (https://github.com/telegramdesktop/tdesktop/issues/24009) has this comment, maybe it sheds some light:

This seem to be a Plasma bug. Qt's SNI implementation seem to set both IconPixmap and IconName what seems absolutely reasonable to me - that way if the icon can't be accessible by name due to sandboxing or etc, panel has a chance to fallback to the pixmap, but Plasma always prefers IconPixmap and then doesn't color it.
Comment 25 Méven Car 2022-04-30 09:42:31 UTC
I don't reproduce under neon master, with telegram installed from official .deb package.

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.24.80
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.3
Kernel Version: 5.13.0-40-generic (64-bit)
Graphics Platform: Wayland
Comment 26 Nate Graham 2022-05-05 17:40:03 UTC
Git commit 7363d0e0f3c1a447e6264e92762735bd33da2682 by Nate Graham, on behalf of Vlad Zahorodnii.
Committed on 05/05/2022 at 17:30.
Pushed by ngraham into branch 'master'.

applets/systemtray: Prefer IconName over IconPixmap

In case both IconName and IconPixmap are provided, the system tray
applet is going to prefer the pixmap.

That can create a dark icon on dark background bug because plasma can't
recolor pixmaps.

The SNI spec recommends visualizations to prefer icons over pixmaps:

> An icon can either be identified by its Freedesktop-compliant icon
> name, carried by this property of by the icon data itself, carried by
> the property IconPixmap. Visualizations are encouraged to prefer icon
> names over icon pixmaps if both are available (FIXME: still not very
> defined: could e the pixmap used as fallback if an icon name is not found?)

M  +40   -36   applets/systemtray/statusnotifieritemsource.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/7363d0e0f3c1a447e6264e92762735bd33da2682
Comment 27 Nate Graham 2022-05-05 17:45:49 UTC
Git commit 919207c0dd88b618a07a0daf09917b8e8912ed87 by Nate Graham, on behalf of Vlad Zahorodnii.
Committed on 05/05/2022 at 17:45.
Pushed by ngraham into branch 'Plasma/5.24'.

applets/systemtray: Prefer IconName over IconPixmap

In case both IconName and IconPixmap are provided, the system tray
applet is going to prefer the pixmap.

That can create a dark icon on dark background bug because plasma can't
recolor pixmaps.

The SNI spec recommends visualizations to prefer icons over pixmaps:

> An icon can either be identified by its Freedesktop-compliant icon
> name, carried by this property of by the icon data itself, carried by
> the property IconPixmap. Visualizations are encouraged to prefer icon
> names over icon pixmaps if both are available (FIXME: still not very
> defined: could e the pixmap used as fallback if an icon name is not found?)
(cherry picked from commit 7363d0e0f3c1a447e6264e92762735bd33da2682)

M  +40   -36   applets/systemtray/statusnotifieritemsource.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/919207c0dd88b618a07a0daf09917b8e8912ed87
Comment 28 Yaroslav Sidlovsky 2022-05-05 18:34:59 UTC
Many thanks for fixing this issue!
Comment 29 Faustino L. Padilla 2022-10-08 19:11:42 UTC
Hi. I've been experiencing this exact same issue on my Arch Linux installation for a couple of weeks now, the icon sometimes shows properly at startup, but it becomes dark shortly after I open the app. I've tried with Breeze Dark and Light variants, and it still the same, it doesn't look properly.  I tried installing multiple Global Themes, icons and nothing seems to fix it. Here are some details of my system, if you need more, please let me know.

Operating System: EndeavourOS
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
Kernel Version: 5.19.13-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 4 × Intel® Core™ i3-5005U CPU @ 2.00GHz
Memory: 7.7 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 5500
Manufacturer: Dell Inc.
Product Name: Inspiron 3558
Comment 30 Nate Graham 2022-10-09 21:09:42 UTC
Cannot reproduce that with current git master, and it sounds like a different issue anyway. Can you file a new bug report for it? Thanks!
Comment 31 Faustino L. Padilla 2022-10-09 22:14:30 UTC
(In reply to Nate Graham from comment #30)
> Cannot reproduce that with current git master, and it sounds like a
> different issue anyway. Can you file a new bug report for it? Thanks!

Thank you for replying! I just opened the new bug report:
https://bugs.kde.org/show_bug.cgi?id=460182