ErikReider / SwayNotificationCenter

A simple GTK based notification daemon for SwayWM
GNU General Public License v3.0
1.15k stars 59 forks source link

[Bug] No icon shown in notifications #356

Closed SteelT1 closed 6 months ago

SteelT1 commented 6 months ago

Describe the bug When showing a notification, the icon in a notification isn't shown, and instead, a blank space of where the icon would normally be shown is there instead.

To Reproduce Steps to reproduce the behavior:

  1. notify-send text -i call-start

Expected behavior Icon in notification appears correctly

Please provide logs if you're experiencing notification errors / bugs https://gist.github.com/SteelT1/5b0f25a3b2814c69be8b2672aeb5e844

Screenshots image

Desktop (please complete the following information):

Additional context This only applies to local icons, icons from web notifications appears just fine.

MrPenguin07 commented 6 months ago

I've also noticed this regression.

I am however impressed with the new notification grouping and styling changes :)

MrPenguin07 commented 6 months ago

I think this may need to be reopened :/

Built the latest master with the fix; (after figuring out the new dep on granite, and gtk-layer-shell now requiring built with +vala on Gentoo which previously did not) I now see an icon - however it's something of an icon placeholder rather than the specified icon.

Eg. I send notifications to Swaync via a script containing: notify-send -e -i /usr/share/icons/Papirus/16x16/apps/system76-driver.svg 'Balanced power profile set'

Result image

Previously there was no icon; placeholder or otherwise

MrPenguin07 commented 6 months ago

Another script I have which sends notifs ends up like this;

image

ErikReider commented 6 months ago

I think this may need to be reopened :/

Built the latest master with the fix; (after figuring out the new dep on granite, and gtk-layer-shell now requiring built with +vala on Gentoo which previously did not) I now see an icon - however it's something of an icon placeholder rather than the specified icon.

Eg. I send notifications to Swaync via a script containing: notify-send -e -i /usr/share/icons/Papirus/16x16/apps/system76-driver.svg 'Balanced power profile set'

Result image

Previously there was no icon; placeholder or otherwise

The icon has to be in the URI format (starting with file://)

MrPenguin07 commented 6 months ago

The icon has to be in the URI format (starting with file://)

My configuration has not changed recently; URI format has certainly never before been required. Is this change in notify-send or how swaync interprets them?

FWIW, I can use the URI in my scripts to see an icon. It is however appearing in notification at a far lower resolution than the original - looks as blocky as minecraft.

ErikReider commented 6 months ago

My configuration has not changed recently; URI format has certainly never before been required. Is this change in notify-send or how swaync interprets them?

This is a recent swaync change. I read the notification spec again and they only support the URI standard. If other daemons like dunst support a regular path, let me know and I'll add it back :)

I want swaync to follow the standards while being as customizable as possible, which is why I changed the behavior.

FWIW, I can use the URI in my scripts to see an icon. It is however at a far lower resolution than the original - looks as blocky as minecraft.

Can you send a screenshot with the command used and the image used?

MrPenguin07 commented 6 months ago

My configuration has not changed recently; URI format has certainly never before been required. Is this change in notify-send or how swaync interprets them?

This is a recent swaync change. I read the notification spec again and they only support the URI standard. If other daemons like dunst support a regular path, let me know and I'll add it back :)

I want swaync to follow the standards while being as customizable as possible, which is why I changed the behavior.

FWIW, I can use the URI in my scripts to see an icon. It is however at a far lower resolution than the original - looks as blocky as minecraft.

Can you send a screenshot with the command used and the image used?

Funny you mention that, I did just test with dunst and yes icon appears fine without using URI heh. Here's with dunst; image

and with swaync; image

I can assure the .svg being called is of high quality and previous swaync HEADs i've been on have all shown it in high qual.

Regards

ErikReider commented 6 months ago

Funny you mention that, I did just test with dunst and yes icon appears fine without using URI heh.

Ok, good to know! I'll get to it when I have time :)

and with swaync;

That's because you're providing a 16x16 png...

MrPenguin07 commented 6 months ago

Funny you mention that, I did just test with dunst and yes icon appears fine without using URI heh.

Ok, good to know! I'll get to it when I have time :)

and with swaync;

That's because you're providing a 16x16 png...

Much appreciated as always! It's an svg which scales up to 4k flawlessly :)

ErikReider commented 6 months ago

It's an svg which scales up to 4k flawlessly :)

The SVG specifies the height and the width to 16px, which would explain why it's blurry. Setting the scaling filter to FAST would show the pixels, so that wouldn't fix it.

image

MrPenguin07 commented 6 months ago

The SVG specifies the height and the width to 16px, which would explain why it's blurry. Setting the scaling filter to FAST would show the pixels, so that wouldn't fix it.

Well interestingly enough, I went back to HEAD 5a23d5eeb576bf981ad40906453366d14e64736a to compare; image

Back to high quality 16x16 heh so something changed.

In any case this is more of an oddity now, I also have these same svg in the 32x32, 48x48, 64x64 etc folders so i've updated my scripts to use the 48x48 versions and they look great once again.

Cheers i'll update my scripts and enjoy the immense work you've put into grouping and whatnot lately. Regards

ErikReider commented 6 months ago

The SVG specifies the height and the width to 16px, which would explain why it's blurry. Setting the scaling filter to FAST would show the pixels, so that wouldn't fix it.

Well interestingly enough, I went back to HEAD 5a23d5e to compare; image

Back to high quality 16x16 heh so something changed.

Very strange indeed... I'll also look into this. Thanks for bisecting :)

ErikReider commented 6 months ago

I'll post another commit to fix the blurryness when I find out what's the root cause

ErikReider commented 6 months ago

@MrPenguin07 74ba2f37 fixes the issue

MrPenguin07 commented 6 months ago

@MrPenguin07 74ba2f3 fixes the issue

Nailed it this time :) Cheers