Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panel icon is blurry #9985

Closed
renyhp opened this issue Dec 23, 2020 · 31 comments · Fixed by #9996
Closed

Panel icon is blurry #9985

renyhp opened this issue Dec 23, 2020 · 31 comments · Fixed by #9996

Comments

@renyhp
Copy link

renyhp commented Dec 23, 2020

Steps to reproduce

  1. Set the Papirus icon theme
  2. Open Telegram

Expected behaviour

The panel icon should be clear

Actual behaviour

The panel icon is blurry

Configuration

Operating system: Xubuntu 20.04.1 LTS

Version of Telegram Desktop: 2.5.1

Installation source (Linux Only): the official website

Used theme: Papirus

The Telegram icon is evidently more blurry than other icons.

2020-12-23_18-18

@ilya-fedin
Copy link
Contributor

tdesktop uses this algorithm to get icon:

if (systemIcon.actualSize(desiredSize) == desiredSize) {
currentImageBack = systemIcon
.pixmap(desiredSize)
.toImage();
} else {
const auto availableSizes = systemIcon.availableSizes();
const auto biggestSize = ranges::max_element(
availableSizes,
std::less<>(),
&QSize::width);
currentImageBack = systemIcon
.pixmap(*biggestSize)
.toImage();
}

As you can see, it tries to get exactly needed size at first, but if icon theme doesn't have it, it gets the biggest size and scales it. Maybe your icon theme just doesn't contain needed size?

@renyhp
Copy link
Author

renyhp commented Dec 23, 2020

These are the files in the icon theme:

/usr/share/icons/Papirus/16x16/panel/telegram-panel.svg
/usr/share/icons/Papirus/22x22/panel/telegram-panel.svg
/usr/share/icons/Papirus/24x24/panel/telegram-panel.svg

I tried setting the panel icon size to 22 or 24, restarting Telegram in between setting changes. The icon is still blurry.

@ilya-fedin
Copy link
Contributor

I even can't reproduce this
image

@renyhp
Copy link
Author

renyhp commented Dec 23, 2020

I'm happy to help reproduce the issue, if you can guide me. I have no experience in tdesktop code.

@ilya-fedin
Copy link
Contributor

Do you have a tdesktop-trayicon-* file in /run/user/$UID (where $UID is UID of your user)?

@renyhp
Copy link
Author

renyhp commented Dec 23, 2020

No.

/run/user$ find . -iname 'tdesktop*'
find: ‘./1000/inaccessible’: Permission denied

@ilya-fedin
Copy link
Contributor

There's Logs spoiler in the issue template, I don't see it in your issue though.

@renyhp
Copy link
Author

renyhp commented Dec 23, 2020

What logs should I report?

I tried simply opening the app from the command line, this is what happens:

$ telegram
[ALSOFT] (EE) Failed to set real-time priority for thread: Operation non permitted (1)
error: : cannot open
error: : cannot open
error: : cannot open
  OpenType support missing for "DAOpenSansRegular", script 11
  OpenType support missing for "DAOpenSansSemibold", script 32
  OpenType support missing for "DAOpenSansSemibold", script 14

If I run it with sudo the icon actually appears clear...

@ilya-fedin
Copy link
Contributor

What logs should I report?

~/.local/share/TelegramDesktop/log.txt

@renyhp
Copy link
Author

renyhp commented Dec 23, 2020

[2020.12.23 20:00:35] Launched version: 2005001, install beta: [FALSE], alpha: 0, debug mode: [TRUE]
[2020.12.23 20:00:35] Executable dir: /opt/Telegram/, name: Telegram
[2020.12.23 20:00:35] Initial working dir: /home/renyhp/.local/share/TelegramDesktop/
[2020.12.23 20:00:35] Working dir: /home/renyhp/.local/share/TelegramDesktop/
[2020.12.23 20:00:35] Command line: /opt/Telegram/Telegram -workdir /home/renyhp/.local/share/TelegramDesktop/ --
[2020.12.23 20:00:35] Executable path before check: /opt/Telegram/Telegram
[2020.12.23 20:00:35] Logs started
[2020.12.23 20:00:35] Launcher filename: appimagekit_46924f6eb8394393510aa1031f302145-Telegram_Desktop.desktop
[2020.12.23 20:00:35] Connecting local socket to /run/user/1000/2ce0f2a80cc9ae6f53407d730a2cce91-{87A94AB0-E370-4cde-98D3-ACC110C5967D}...
[2020.12.23 20:00:35] This is the only instance of Telegram, starting server and app...
[2020.12.23 20:00:35] Moved logging from '/home/renyhp/.local/share/TelegramDesktop/log_start0.txt' to '/home/renyhp/.local/share/TelegramDesktop/log.txt'!
[2020.12.23 20:00:35] Primary screen DPI: 96
[2020.12.23 20:00:35] Font: from ':/gui/fonts/DAOpenSansRegular.ttf' loaded 'DAOpenSansRegular'
[2020.12.23 20:00:35] Font: from ':/gui/fonts/DAVazirRegular.ttf' loaded 'DAVazirRegular'
[2020.12.23 20:00:35] Font: from ':/gui/fonts/DAOpenSansRegularItalic.ttf' loaded 'DAOpenSansRegularItalic'
[2020.12.23 20:00:35] Font: from ':/gui/fonts/DAVazirRegular.ttf' loaded 'DAVazirRegular'
[2020.12.23 20:00:35] Font: from ':/gui/fonts/DAOpenSansSemiboldAsBold.ttf' loaded 'DAOpenSansSemibold'
[2020.12.23 20:00:35] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2020.12.23 20:00:35] Font: from ':/gui/fonts/DAOpenSansSemiboldItalicAsBold.ttf' loaded 'DAOpenSansSemiboldItalic'
[2020.12.23 20:00:35] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2020.12.23 20:00:35] Font: from ':/gui/fonts/DAOpenSansSemiboldAsBold.ttf' loaded 'DAOpenSansSemibold'
[2020.12.23 20:00:35] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2020.12.23 20:00:35] Font: from ':/gui/fonts/DAOpenSansSemiboldItalicAsBold.ttf' loaded 'DAOpenSansSemiboldItalic'
[2020.12.23 20:00:35] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2020.12.23 20:00:35] App Info: reading settings...
[2020.12.23 20:00:35] App Info: reading encrypted settings...
[2020.12.23 20:00:35] Lang Info: Loaded cached, keys: 2910
[2020.12.23 20:00:35] OpenAL Logging Level: (not set)
[2020.12.23 20:00:35] Audio Playback Devices: Audio interno Stereo analogico;Audio interno Stereo analogico (echo cancelled with PC-LM1E Camera Stereo analogico)
[2020.12.23 20:00:35] Audio Playback Default Device: Audio interno Stereo analogico
[2020.12.23 20:00:35] Audio Capture Devices: CancelledNoise;PC-LM1E Camera Stereo analogico;Monitor of Audio interno Stereo analogico;Monitor of Audio interno Stereo analogico (echo cancelled with PC-LM1E Camera Stereo analogico)
[2020.12.23 20:00:35] Audio Capture Default Device: CancelledNoise
[2020.12.23 20:00:35] System tray available: [TRUE]
[2020.12.23 20:00:35] Not using D-Bus global menu.
[2020.12.23 20:00:35] Using Unity launcher counter.
[2020.12.23 20:00:35] Getting DE, XDG_CURRENT_DESKTOP: 'XFCE'
[2020.12.23 20:00:35] Getting DE, DESKTOP_SESSION: 'xubuntu'
[2020.12.23 20:00:35] Getting DE, KDE_SESSION_VERSION: ''
[2020.12.23 20:00:35] DE: XFCE
[2020.12.23 20:00:35] App Info: reading accounts info...
[2020.12.23 20:00:35] App Info: reading encrypted info...
[2020.12.23 20:00:35] App Info: reading map...
[2020.12.23 20:00:35] App Info: reading encrypted map...
[2020.12.23 20:00:35] App Info: reading encrypted user settings...
[2020.12.23 20:00:35] App Info: encrypted user settings read.
[2020.12.23 20:00:35] App Info: reading encrypted mtp data...
[2020.12.23 20:00:35] MTP Info: read keys, current: 5, to destroy: 0
[2020.12.23 20:00:35] Map read time: 0
[2020.12.23 20:00:35] App Info: reading encrypted mtp config...
[2020.12.23 20:00:35] Notification daemon product name: Xfce Notify Daemon
[2020.12.23 20:00:35] Notification daemon vendor name: Xfce
[2020.12.23 20:00:35] Notification daemon version: 0.4.4
[2020.12.23 20:00:35] Notification daemon specification version: 1.2
[2020.12.23 20:00:35] Notification daemon capabilities: actions, body, body-hyperlinks, body-markup, icon-static, x-canonical-private-icon-only
[2020.12.23 20:00:35] TCP Error: network - Network unreachable
[2020.12.23 20:00:35] HTTP Error: network error 99 - Network unreachable
[2020.12.23 20:00:35] Export Info: Destroy top bar by controller removal.
[2020.12.23 20:00:35] Using SNI tray icon.

@ilya-fedin
Copy link
Contributor

ilya-fedin commented Dec 23, 2020

Could please you show your list of panel applets?

@renyhp
Copy link
Author

renyhp commented Dec 23, 2020

I hope this answers... if not, please point me to what I should report you

$ grep 'property name="plugin-' .config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml 
      <property name="plugin-ids" type="array">
      <property name="plugin-ids" type="array">
    <property name="plugin-1" type="string" value="whiskermenu"/>
    <property name="plugin-2" type="string" value="separator">
    <property name="plugin-3" type="string" value="tasklist">
    <property name="plugin-4" type="string" value="separator">
    <property name="plugin-5" type="string" value="systray">
    <property name="plugin-6" type="string" value="notification-plugin"/>
    <property name="plugin-7" type="string" value="indicator">
    <property name="plugin-8" type="string" value="statusnotifier">
    <property name="plugin-10" type="string" value="pulseaudio">
    <property name="plugin-11" type="string" value="separator">
    <property name="plugin-12" type="string" value="clock">
    <property name="plugin-9" type="string" value="whiskermenu"/>
    <property name="plugin-13" type="string" value="separator">
    <property name="plugin-15" type="string" value="tasklist">
    <property name="plugin-16" type="string" value="separator">
    <property name="plugin-17" type="string" value="notification-plugin"/>
    <property name="plugin-18" type="string" value="statusnotifier">
    <property name="plugin-19" type="string" value="indicator">
    <property name="plugin-20" type="string" value="pulseaudio">
    <property name="plugin-21" type="string" value="separator">
    <property name="plugin-22" type="string" value="clock"/>

2020-12-23_20-11

@ilya-fedin
Copy link
Contributor

I need this
image

@ilya-fedin
Copy link
Contributor

vokoscreen-2020-12-23_23-34-01.mp4

@renyhp
Copy link
Author

renyhp commented Dec 23, 2020

In my understanding, those are taken from the file I grepped from. Anyway, here it is:

2020-12-23_20-35

@ilya-fedin
Copy link
Contributor

Oh. Its really, really weird. I thought that the XML is wrong, but looks like you really have three tray applets at once.

@renyhp
Copy link
Author

renyhp commented Dec 23, 2020

Yes, I know, tray icons are a mess... Most of my applications (Telegram included) use statusnotifier. Claws Mail uses systray. Nothing is actually using indicator, but it was there by default. (And IIUC notification-plugin is not actually an applet adding tray icons)

@ilya-fedin
Copy link
Contributor

ilya-fedin commented Dec 23, 2020

I reproduced, it's a statusnotifier bug. Telegram provides an array of pixmaps with different sizes and the applet takes the biggest one and downscales it instead of just using the most appropriate one.

@renyhp
Copy link
Author

renyhp commented Dec 23, 2020

Thank you!

Just a simple question: can Telegram work around this bug? Seems like other apps did that too...

@ilya-fedin
Copy link
Contributor

Nothing is actually using indicator

Because both statusnotifier and indicator implement the same spec (indicator supports only a subset of the spec though, it's Canonical's implementation and used only in Ubuntu), they conflict and only one of them could work at the same time.

@ilya-fedin
Copy link
Contributor

can Telegram work around this bug? Seems like other apps did that too...

Other applications don't have a counter and just supplying an icon name. Since tdesktop generates icon on the fly for the counter, the only way is to supplying pixmaps.

@ilya-fedin
Copy link
Contributor

ilya-fedin commented Dec 23, 2020

If you remove all tray applets except of systray (indicator, statusnotifier) from the list, all applications should start using it after a relogin.

@renyhp
Copy link
Author

renyhp commented Dec 23, 2020

Well okay, I guess, but now all other apps have started glitching...

2020-12-23_22-38

@ilya-fedin
Copy link
Contributor

electron...

@renyhp
Copy link
Author

renyhp commented Dec 23, 2020

Is there no way that telegram could use systray without the user having to remove statusnotifier from the panel? (Like Claws Mail is doing, for example)

@ilya-fedin
Copy link
Contributor

ilya-fedin commented Dec 23, 2020

I think you should ask (and maybe help) statusnotifier developers to fix it instead of searching for workarounds.

@renyhp
Copy link
Author

renyhp commented Dec 24, 2020

I posted in statusnotifier bug list.

Something I was wondering though: if this were a problem with statusnotifier downscaling the wrong image, there should be one icon size that makes Telegram's icon nice and clean. I tried setting the panel icon size to various sizes and the icon is always blurrier than others.

16px: 16

22px: 22

24px: 24

48px: 48

64px: 64

@ilya-fedin
Copy link
Contributor

Maybe your icon theme doesn't have 48px size? It's the biggest that Telegram provides and if statusnotifier uses it, it will be upscaled by Telegram if icon theme doesn't have such size and right after that downscaled by statusnotifier.

@ilya-fedin
Copy link
Contributor

Looks like I found what's the problem: QIcon::actualSIze doesn't work as expected

@github-actions
Copy link

github-actions bot commented Mar 3, 2021

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants