bepass-org / oblivion-desktop

Oblivion Desktop - Unofficial Warp Client for Windows/Mac/Linux
https://github.com/bepass-org/oblivion-desktop/releases
Other
4.56k stars 544 forks source link

System tray icon after connection does not show correctly under GNOME desktop in Arch Linux #348

Closed morealaz closed 1 month ago

morealaz commented 1 month ago

Attention | توجه

What Happened? | چه اتفاقی افتاده؟

After connecting successfully to WARP, system tray icon does not appear correctly, but before connection it is ok.

before connection image

after connection image

Minimal Reproducible Example | چه پروسه‌ای برای مشاهده این مشکل طی کرده‌اید؟

No response

Relevant log output | لاگ برنامه

[2024-06-18 16:33:43.328] [info]  past logs was deleted for new connection.
[2024-06-18 16:33:43.330] [info]  ------------------------MetaData------------------------
[2024-06-18 16:33:43.330] [info]  running on: linux 6.9.5-arch1-1 x64
[2024-06-18 16:33:43.330] [info]  at od: 0.23.15-beta
[2024-06-18 16:33:43.331] [info]  at wp: v1.2.3
[2024-06-18 16:33:43.374] [info]  ls assets/bin: LICENSE,README.md,warp-plus
[2024-06-18 16:33:43.375] [info]  method: warp
[2024-06-18 16:33:43.375] [info]  proxyMode: true
[2024-06-18 16:33:43.376] [info]  routingRules: Customized
[2024-06-18 16:33:43.376] [info]  endpoint: custom
[2024-06-18 16:33:43.377] [info]  license: false
[2024-06-18 16:33:43.377] [info]  exe: /opt/Oblivion Desktop/oblivion-desktop
[2024-06-18 16:33:43.377] [info]  userData: /home/<USERNAME>/.config/oblivion-desktop
[2024-06-18 16:33:43.377] [info]  logs: /home/<USERNAME>/.config/oblivion-desktop/logs
[2024-06-18 16:33:43.378] [info]  ------------------------MetaData------------------------
[2024-06-18 16:33:43.384] [info]  starting wp process...
[2024-06-18 16:33:43.385] [info]  /home/<USERNAME>/.config/oblivion-desktop/warp-plus --bind 127.0.0.1:8086 --gool --endpoint 188.114.98.224:2408
[2024-06-18 16:33:43.410] [info]  trying to set system proxy...
[2024-06-18 16:33:43.448] [info]  gsettings found!
[2024-06-18 16:33:43.756] [info]  Enabled proxy for GNOME.
time=2024-06-18T16:33:44.041+03:30 level=INFO msg="using warp endpoints" endpoints="[188.114.98.224:2408 188.114.98.224:2408]"
time=2024-06-18T16:33:44.041+03:30 level=INFO msg="running in warp-in-warp (gool) mode"

time=2024-06-18T16:33:44.082+03:30 level=INFO msg="successfully loaded warp identity" subsystem=warp/account

time=2024-06-18T16:33:50.293+03:30 level=INFO msg="connection test successful"

time=2024-06-18T16:33:50.315+03:30 level=INFO msg="successfully loaded warp identity" subsystem=warp/account

time=2024-06-18T16:33:52.974+03:30 level=INFO msg="connection test successful"

time=2024-06-18T16:33:52.998+03:30 level=INFO msg="serving proxy" address=127.0.0.1:8086

time=2024-06-18T16:33:53.602+03:30 level=INFO msg="handling connection" subsystem=vtun protocol=tcp destination=cloudflare.com:443
ircfspace commented 1 month ago

Hi, I have made a change to the code related to the issue you reported. I would appreciate it if you could test the next update (which will be released soon) and let me know the results.

morealaz commented 1 month ago

Hi, I have made a change to the code related to the issue you reported. I would appreciate it if you could test the next update (which will be released soon) and let me know the results.

Hi, I built app with your new changes, but problem still remained and this time even clicking on tray icon does not show any menu.

I checked your changes and noticed a mistake and fixed it with this code:

const trayIconChanger = (status: string) => {
    const nativeImageIcon = nativeImage.createFromPath(
        getAssetPath(`img/status/${status}.png`)
    );
    if (process.platform === 'darwin') {
        return nativeImageIcon.resize({ width: 16, height: 16 });
    } else {
        return nativeImageIcon;
    }
};

but after building app again and testing it, problem still remains but this time tray menu showed again and got fixed.

I think problem is somewhere else in the code. probably where the tray icon going to be set after connecting.

ircfspace commented 1 month ago

I made another change. If you have the means to test it, please check it out. If any errors occur, they should naturally be logged during development.

morealaz commented 1 month ago

I made another change. If you have the means to test it, please check it out.

I tested new changes and tray icon did not change again.

If any errors occur, they should naturally be logged during development.

That's the interesting part. This is the new log message which you added:

Failed to load trayIcon: /usr/lib/oblivion-desktop/assets/img/status/connected-undefined.png

I think the problem is that undefined returned as connection status. Don't worry about assets path. It is correct and working. I set it in Arch Linux Package which I use for installing Oblivion.

ircfspace commented 1 month ago

Thank you for the test you conducted. Based on the provided logs, the issue has been identified and resolved.

morealaz commented 1 month ago

Hi @ircfspace thanks again for fixing this annoying bug. Now that we find the source of this bug, I think we can safely change back these lines of code which we previously thought was source of this bug:

const trayIconChanger = (status: string): any => {
    connectionStatus = String(status);
    const iconPath = getAssetPath(`img/status/${status}.png`);
    const nativeImageIcon = nativeImage.createFromPath(iconPath);
    if (!nativeImageIcon.isEmpty()) {
        if (process.platform === 'darwin') {
            return nativeImageIcon.resize({ width: 16, height: 16 });
        } else {
            return nativeImageIcon;
        }
    } else {
        console.error(`Failed to load trayIcon: ${iconPath}`);
        return null;
    }
};

and return 16 pixels image for all platform not just Mac! I checked GNOME UI design guidelines and they also recommended 16 pixels size icons. I tested it on GNOME with changing these codes to return 16 pixels icons, and it worked without any problem. What is your thought on this matter?

ircfspace commented 1 month ago

Thank you, This has been considered for all OS (except Windows).