fix(notifications): show fallback icon instead of checkerboard for missing theme icons

When Qt cannot resolve a notification icon name (e.g. "audio-headset" from
Blueman) because the icon theme is not properly configured, the
IconImageProvider returns a purple/black checkerboard missingPixmap.

Check icon existence via ThemeIcons.iconExists() before returning the
image:// URI, so NImageRounded displays its fallback icon instead.
This commit is contained in:
Adria Martin
2026-04-10 16:35:48 +07:00
parent e85ce902cb
commit 093f3632d2
+5
View File
@@ -770,6 +770,11 @@ Singleton {
return ""; return "";
if (icon.startsWith("/") || icon.startsWith("file://")) if (icon.startsWith("/") || icon.startsWith("file://"))
return icon; return icon;
// Verify the icon exists in the theme before returning its image:// URI.
// Without this check, missing icons render as the purple/black checkerboard
// from IconImageProvider::missingPixmap instead of the notification fallback icon.
if (!ThemeIcons.iconExists(icon))
return "";
return ThemeIcons.iconFromName(icon); return ThemeIcons.iconFromName(icon);
} }