Foundry376 / Mailspring

:love_letter: A beautiful, fast and fully open source mail client for Mac, Windows and Linux.
https://getmailspring.com/
GNU General Public License v3.0
15.55k stars 907 forks source link

Tray icon is too small at Gnome Shell #648

Closed a2nt closed 5 years ago

a2nt commented 6 years ago

Take a look at screen shoot: 1 icon of Harmony (too big) nodejs-app 2 icon is MailSpring (too small) nodejs-app 3 is Skype (too small) nodejs-app 4 is Slack (it's good one) nodejs-app All the other icons are Gnome native and looks ok.

Distributor ID: Debian
Description:    Debian GNU/Linux 9.0 (stretch)
Release:    9.0
Codename:   stretch
Display: QHD+ (Dell XPS13 9360)

screenshot from 2018-02-06 18-07-56

gmagic commented 6 years ago

Mine is OK. I think it's gnome extension's glitch. Try to use TopIcons Plus. 2018-02-06 15-53-20

a2nt commented 6 years ago

still the same glitch, it was ok for a while and now it's not

a2nt commented 6 years ago

Got an other glitch on reopenning MailSpring screenshot from 2018-02-06 20-42-37 screenshot from 2018-02-06 20-42-55 screenshot from 2018-02-06 20-44-31 screenshot from 2018-02-06 20-45-38

gmagic commented 6 years ago

I think it's not Mailspring bug. Look at you skype icon. Maybe it depends on Gnome Shell version. Look at my settings of Topicons Plus 2018-02-06 18-45-01

bengotow commented 6 years ago

Hey folks—hmm this is interesting. In the most recent release (1.1.3) I actually shrank the images we use for the linux system tray to 22x22px instead of 32x32px because people were complaining it was too big on many distros including Ubuntu! I also fixed a bug that was causing the app to refresh the image constantly, which might have been confusing Gnome shell.

Can you try downloading 1.1.3 from getmailspring.com/download and see if it resolves the issue for you?

dennisotugo commented 6 years ago

I would recommend https://github.com/bil-elmoussaoui/Hardcode-Tray . It sets all the tray icons to a consistent size and styling.

a2nt commented 6 years ago

@bengotow Slack icon always ok (not big, not small, doesn't pops up and down), but I had an issue with Museeks. Icon was too small, but take a look to this fix: https://github.com/a2nt/museeks/commit/4a8070339002cc103b764771d8190bc830415e51 I have removed resizing to 24x24 and it's absolutely ok now.

a2nt commented 6 years ago

@dennisotugo it looks like this script replaces icons why not to include specific icon into application without extra software. Slack is nodejs based and works perfectly with tray

a2nt commented 6 years ago

@bengotow made tests closing and opening WebTorrent app, opening and closing extra nodejs apps with WebTorrent launched, relaunching WebTorrent - works perfect too.

Here's they're tray code: https://github.com/webtorrent/webtorrent-desktop/blob/8d86cffabd121383047f137d810e3eb269bf110f/src/main/windows/main.js

Here's icon that they use: https://github.com/webtorrent/webtorrent-desktop/blob/master/static/WebTorrent.png

Looks like that they add kinda big icon without resizing into tray, maybe u need transparent borders around icon or try ImageOptim against png. Not sure, can u show me source of MailSpring tray so I can try it?

Red icon it's webtorrent app, small misplaced icon it's MailSpring 1.1.3: screenshot from 2018-02-07 09-26-37

And here's the settings of TopIcon Plus: screenshot from 2018-02-07 09-28-38

I have 13.3” QHD+ (3200 x 1800) display so Gnome scaling is set to 200% maybe it cause the problem, but anyway Webtorrent and Slack don't have such issues

a2nt commented 6 years ago

Clicked to tray so now icon looks this way: screenshot from 2018-02-07 09-39-37 It never happens with the other nodejs apps

a2nt commented 6 years ago

Take a look to quick solution for gnome-shell without breaking gtk2 based window managers: https://github.com/KeitIG/museeks/pull/388/commits/a82ed10daea3aaeace474cfa76d3b63e08329663 It detects if gnome-shell process is running and updates tray icon to compatible one.

bengotow commented 6 years ago

Hey @a2nt — I'd absolutely love if you could try playing with this to find the right solution. It looks like we got another report (#670) that the tray icon is now too small in Hi-DPI scenarios (which makes sense, considering I shrunk the images...) I'm not sure how to get the right result across Linux distros, because it seems like some of them don't downsample the image on their own and we get this: https://github.com/Foundry376/Mailspring/issues/621.

The source code that sets the tray icon is here (the paths to the images are determined based on your platform at the top of that file): https://github.com/Foundry376/Mailspring/blob/master/app/internal_packages/system-tray/lib/system-tray-icon-store.es6#L75

The assets are in the app's package here: https://github.com/Foundry376/Mailspring/tree/master/app/internal_packages/system-tray/assets

dennisotugo commented 6 years ago

@bengotow It is down to the desktops themselves, for example Gnome requires 16px icon but not KDE which requires 24px to not look odd. This is the dilemma of having multiple options.

dennisotugo commented 6 years ago

@a2nt Slack doesn't look right in KDE for example. They cannot include specific icon because there is nothing specific. There is not a standard tray icon size. Also on this issue, have you tried logging into a new user and using just top-icons plus. This issue seems familiar and is not specific to mailspring. Mailspring tray icon in Gnome is okay.

a2nt commented 6 years ago

@dennisotugo I suggest to detect by ps-node running gnome-shell process and display specific icon

bengotow commented 6 years ago

Hey folks—that museeks solution above seems like a good approach to me. Looks like they default to 24px and if they detect gnome-shell they use a full-res image (actually 96x96px) instead of the resized one. If anyone wants to take a stab at this, let me know!

bengotow commented 5 years ago

Hey folks! There's a note in today's Electron release that I think relates to this: Fixed issue on KDE where tray icons would be displayed incorrectly as a 22x22 version of the provided tray image but cropped from the center. #17497. Very hopeful this will fix this issue! https://github.com/electron/electron/releases

bengotow commented 5 years ago

Hey folks! This should be addressed in the latest release (1.6.3) that shipped earlier this week. The app should auto-update on it's own, or you can grab the new version from the releases page: https://github.com/Foundry376/Mailspring/releases/. Thanks for filing this - enjoy the update!