squalou / google-chat-linux

source of a fork of google-chat-linux unofficial client from robyf
50 stars 10 forks source link

Fix system tray and app icon paths #60

Closed vwbusguy closed 1 year ago

vwbusguy commented 1 year ago

This causes icons for system tray and application icons to successfully load by loading them from the assets path relative to path.js rather than the electron path.

Possibly fixes #56 and clears the related errors in Gnome 43 reported in #59 .

vwbusguy commented 1 year ago

The last commit might not be necessary, but I replaced "../" with dirname() in case it gives better compatibility for Windows users (I am not a Windows user and don't have a way to test whether it actually makes any difference.)

vwbusguy commented 1 year ago

With the last update, I think this should be working now for Windows as well as Linux. It works for me, at least on Fedora and at least the code looks better than my original PR commit.

squalou commented 1 year ago

Great thank you ! LGTM, will it just in case for my use on arch/xfce but can't see why it would not work.

Release planned today ;)

squalou commented 1 year ago

Note : I'm having issues with trayicon update under xfce.

Failed to update window icon :-(
Error: Failed to load image from path '/opt/google-chat-linux/resources/app.asar/assets/icon/normal-64.png'
    at Object.updateIcon (/opt/google-chat-linux/resources/app.asar/src/window.js:152:14)
    at setIcon (/opt/google-chat-linux/resources/app.asar/src/tray.js:99:16)
    at IpcMainImpl.<anonymous> (/opt/google-chat-linux/resources/app.asar/src/tray.js:77:2)

will try to fix it

using 'path' was done long ago but is an issue. I'll maybe end up with a 'if win32' :)

squalou commented 1 year ago

hmmm, cannot make it work both on xfce and gnome with your code. It's even a bit more complicated that that : behavior is not the same bewteen xfce and gnome and most of all : behavior is not the same when run from source code, or from installed compiler assets.

It must work once installed, too bad if it fails from source. Assets resolutions are not the same, in one case it's path to files, in the other situation it's resolved against packaged assets.

I have no windows to test against sadly.

Could you tell me if you tried with a properly npm run build .exe fresh install ?