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

Default electron tray icon on GNOME #464

Closed
Vallasc opened this issue Nov 18, 2021 · 19 comments
Closed

Default electron tray icon on GNOME #464

Vallasc opened this issue Nov 18, 2021 · 19 comments

Comments

@Vallasc
Copy link

Vallasc commented Nov 18, 2021

I'm on GNOME and it show the default electron tray icon instead of showing the app logo.
Screenshot-20211118191444-456x23

@vladimiry
Copy link
Owner

vladimiry commented Nov 19, 2021

The issue is not reproducible on Ubuntu 21.04 with Gnome 3.38.5. The app was installed from https://snapcraft.io/electron-mail.

Did you install it form https://snapcraft.io/electron-mail ?

@Vallasc
Copy link
Author

Vallasc commented Nov 19, 2021

I installed it via flathub
Pop!_OS 21.04
GNOME 3.38.4

@vladimiry
Copy link
Owner

Can you also test the DEB package and/or https://snapcraft.io/electron-mail?

@Vallasc
Copy link
Author

Vallasc commented Nov 19, 2021

I tried the AppImage and DEB version but the issue persists

@vladimiry
Copy link
Owner

vladimiry commented Nov 19, 2021

Thanks. It appears to be the Pop!_OS specific then. I'm not going to install the Pop!_OS in the near future to troubleshoot the issue.

@vladimiry
Copy link
Owner

Does setting the XDG_CURRENT_DESKTOP=Unity env variable make any difference?

@Vallasc
Copy link
Author

Vallasc commented Nov 19, 2021

No difference
bug

@vladimiry
Copy link
Owner

Thanks. So for now it would be up to someone who uses Pop!_OS to find the workaround.

@Vallasc
Copy link
Author

Vallasc commented Nov 19, 2021

I think the error is on tray.ts

On line 13
const tray = new Tray(nativeImage.createEmpty());

You should pass the image path to the Try constructor.
I tried to edit the file but I can't find the path of the icon.

@vladimiry
Copy link
Owner

vladimiry commented Nov 20, 2021

@Vallasc, it's a lot more complex than you have explored so far. Locate the tray.setImage() calls in https://github.com/vladimiry/ElectronMail/blob/master/src/electron-main/api/endpoints-builders/tray-icon/index.ts. The tray icon is dynamically/programmatically rendered.
icon

@vladimiry
Copy link
Owner

vladimiry commented Nov 20, 2021

The app has been installed from flathub (via default PopOS's app manager). Clean system (VirtualBox).

123

@Vallasc
Copy link
Author

Vallasc commented Nov 20, 2021

I found the problem. Disabling Papirus icon pack the icon is shown in the right way.

@vladimiry
Copy link
Owner

Thanks for sharing the issue cause.

@vladimiry
Copy link
Owner

vladimiry commented Nov 20, 2021

It appears that papirus-icon-theme does something with the tray icons for some reason https://github.com/PapirusDevelopmentTeam/papirus-icon-theme/search?q=electronmail&type=commits

@Vallasc
Copy link
Author

Vallasc commented Nov 20, 2021

I have removed all electron icons from the icon theme directory and now it works as it should. Thanks.

@varlesh
Copy link

varlesh commented Nov 21, 2021

It appears that papirus-icon-theme does something with the tray icons for some reason https://github.com/PapirusDevelopmentTeam/papirus-icon-theme/search?q=electronmail&type=commits

We not doing something with the tray icons. Application use electron icon name instead of electron-mail.
It's not our bug.
image

@varlesh
Copy link

varlesh commented Nov 21, 2021

@vladimiry Вообще Papirus ничего не ломает и hardcode-tray тоже.
Ваш значок (раскрашенный в #dfdfdf):
image
Наш значок, с hardcode-tray (с дефолтным цветом #1ba489):
image
Проверенно в KDE. Для правильной логики программы могу просто перекрасить значок для трея в цвет #1ba489 и всё будет работать как и задумано.

varlesh added a commit to PapirusDevelopmentTeam/papirus-icon-theme that referenced this issue Nov 21, 2021
This exception only for hardcode-tray and does not break the program logic.  Our icons have perfect pixel align for 16/22/24px tray icons. You can choose colors on application settings. With Papirus colors it's can be #dfdfdf/#444444 and notification color #4285f4
vladimiry/ElectronMail#464
@varlesh
Copy link

varlesh commented Nov 21, 2021

Пофиксил, наш значок не ломает логику разукрашивания значка и все работает как и положено.
По факту, наши костыли ненужны и ваше решение очень крутое. Но hardcode-tray и Papirus подгоняет размер значка и он не будет больше или меньше других в трее, ну и плюс выравнивание по пикселям, т.к. GNOME использует 16px, KDE 22px, а XFCE может само выбрать нужный размер.
image

@vladimiry
Copy link
Owner

vladimiry commented Nov 21, 2021

We not doing something with the tray icons. Application use electron icon name instead of electron-mail.
It's not our bug.

Does something means exactly this, doing something. I didn't look deep into the commit.

Для правильной логики программы могу просто перекрасить значок для трея в цвет #1ba489 и всё будет работать как и задумано.

Yep, the #1ba489 value is hardcoded in the app as a base color of the static tray icon. So the app then could use that value as a base color for recoloring when the respective settings gets changed in the app as displayed in #464 (comment).

Anyway, the outcome is that papirus-icon-theme got the fix so now it doesn't break the app's UX-related features and fills the ticks of its own checklist at the same time which should be good for everyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants