Bug 498530 - Some icons drawn by Kirigami.icon don't highlight when "active" property is set to true
Summary: Some icons drawn by Kirigami.icon don't highlight when "active" property is s...
Status: CONFIRMED
Alias: None
Product: frameworks-kirigami
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 6.10.0
Platform: Arch Linux Linux
: NOR minor
Target Milestone: 1.0
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-11 14:54 UTC by thegrandfinale2001
Modified: 2025-01-16 00:30 UTC (History)
4 users (show)

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


Attachments
System Tray Highlighting (371.80 KB, video/x-matroska)
2025-01-14 02:56 UTC, thegrandfinale2001
Details

Note You need to log in before you can comment on or make changes to this bug.
Description thegrandfinale2001 2025-01-11 14:54:26 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***

SUMMARY
Some icons in the system tray show highlighting when you hover over them, and others do not.

STEPS TO REPRODUCE
1. Hover over different icons in the system tray.
2. 
3. 

OBSERVED RESULT
Some icons show highlighting, and others do not.

EXPECTED RESULT
All icons should highlight when hovered over.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux X11
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.9.0
Qt Version: 6.8.1

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2025-01-13 20:05:15 UTC
Which ones don't?

Also what color scheme are you using?

Vor a visual issue like this, a screen recording would be helpful.
Comment 2 thegrandfinale2001 2025-01-14 02:56:45 UTC
Created attachment 177339 [details]
System Tray Highlighting

I go through a few apps and some have highlighting and some do not.
Comment 3 thegrandfinale2001 2025-01-14 02:59:37 UTC
(In reply to Nate Graham from comment #1)
> Which ones don't?
> 
> Also what color scheme are you using?
> 
> Vor a visual issue like this, a screen recording would be helpful.

I'm using default Breeze color scheme.  Also I should specify that KDE app tray icons all highlight, it's random when it comes to non KDE apps.
Comment 4 Nate Graham 2025-01-14 17:07:05 UTC
Wow, that's a lot of system tray icons. Let me look through the code to see if I can figure out the case where no highlighting happens.
Comment 5 Nate Graham 2025-01-14 17:23:08 UTC
As far as I can tell, the system tray is doing everything right: it's setting Kirigami.Icon's "active" property on hover, as evidenced by the fact that *some* of your 3rd-party tray icons are honoring it.

The only option I can see here is that for some of those icons, Kirigami.Icon's "active" state doesn't produce any visual changes for whatever reason. It looks like it's simply engaging the QIcon::Active mode in QIcon code itself, so it's possible this is also a Qt issue.

Regardless, moving to Kirigami for further investigation.
Comment 6 thegrandfinale2001 2025-01-14 19:30:12 UTC
(In reply to Nate Graham from comment #5)
> As far as I can tell, the system tray is doing everything right: it's
> setting Kirigami.Icon's "active" property on hover, as evidenced by the fact
> that *some* of your 3rd-party tray icons are honoring it.
> 
> The only option I can see here is that for some of those icons,
> Kirigami.Icon's "active" state doesn't produce any visual changes for
> whatever reason. It looks like it's simply engaging the QIcon::Active mode
> in QIcon code itself, so it's possible this is also a Qt issue.
> 
> Regardless, moving to Kirigami for further investigation.

Thanks for taking a look!!
Comment 7 Nicolas Fella 2025-01-16 00:30:39 UTC
(In reply to Nate Graham from comment #5)
> As far as I can tell, the system tray is doing everything right: it's
> setting Kirigami.Icon's "active" property on hover, as evidenced by the fact
> that *some* of your 3rd-party tray icons are honoring it.
> 
> The only option I can see here is that for some of those icons,
> Kirigami.Icon's "active" state doesn't produce any visual changes for
> whatever reason. It looks like it's simply engaging the QIcon::Active mode
> in QIcon code itself, so it's possible this is also a Qt issue.
> 
> Regardless, moving to Kirigami for further investigation.

The difference seems to be between icons provided by name and icons provided as a pixmap. For example Strawberry provides a pixmap and that doesn't get a visible active effect.

When Kirigami.Icon gets a pixmap it loads that into an image (https://invent.kde.org/frameworks/kirigami/-/blob/master/src/primitives/icon.cpp?ref_type=heads#L362) and more or less directly renders that, without applying any mode.

I tried to change that by first creating a QIcon from the pixmap and then obtaining a pixmap with the right mode from that. That ends up in https://invent.kde.org/qt/qt/qtbase/-/blob/dev/src/widgets/styles/qcommonstyle.cpp#L6204 where some effects are applied, but for Active it doesn't apply anything. Given how deep in Qt this is I'm rather hesistant about changing anything there