Ximi1970 / systray-x

SysTray-X: A system tray extension for Thunderbird. Needs both the addon AND the companion app installed to work. Will not work with TB flatpaks or snaps.
Mozilla Public License 2.0
216 stars 15 forks source link

Not working with Thunderbird 128 #199

Open nicolamori opened 3 days ago

nicolamori commented 3 days ago

Describe the bug I just updated to Thunderbird 128.2.0 and systray-x is now reported as incompatible.

To Reproduce Update to Thunderbird 128 and verify that the tray icon is no longer visible in the system tray.

Desktop (please complete the following information):

NoahC500 commented 3 days ago

Just to add to this, also wasn't working on my Arch install running KDE Wayland, but is working KDE Xorg/X11.

The icon is visible in the tray but closing the TB window does nothing (i.e. the window doesn't close) and minimising doesn't minimise to tray.

EDIT: Is working with the Wayland workaround in the README, perhaps the use X11 env var was removed in update?

Ximi1970 commented 3 days ago

Update the SysTray-X version......Latest version is 0.9.10.

Ximi1970 commented 3 days ago

@NoahC500 use the special start for thunderbird in Wayland: https://github.com/Ximi1970/systray-x#using-the-addon-with-wayland

Antiz96 commented 3 days ago

@NoahC500 use the special start for thunderbird in Wayland: https://github.com/Ximi1970/systray-x#using-the-addon-with-wayland

It seems like it doesn't work with thunderbird 128+ anymore. Using GDK_BACKEND=x11 prevents systray-x from starting. Not using GDK_BACKEND=x11 (meaning starting thunderbird normally), makes systray-x appearing but the show/hide and quit actions are not working.

Ximi1970 commented 3 days ago

I checked it again....Did it also yesterday already for Arch. Still working just fine. You need to use env GDK_BACKEND=x11 thunderbird.

It will give the "output"

Error: Failed to open Wayland display, fallback to X11. WAYLAND_DISPLAY='wayland-0' DISPLAY=':1'

and startup nicely.

And if you do not use the above, the plugin cannot control the TB window because wayland does not allow it (and/or has no API for it). Only X11 allows "external" control of windows.

Antiz96 commented 3 days ago

@Ximi1970 Have you tried on Arch with Thunderbird 128?

What you are describing works with Thunderbird 115 but not with Thunderbird 128 (which was released 2 days ago in Arch).

Ximi1970 commented 3 days ago

I have the latest Arch (updated yesterday and today) KDE with TB128.2.0esr running in a VM.

image

Ximi1970 commented 3 days ago

And twenty other distributions....

Antiz96 commented 3 days ago

Well, doesn't work on my side (on Sway). Here's the output:

$ env GDK_BACKEND=x11 /usr/bin/thunderbird
Error: Failed to open Wayland display, fallback to X11. WAYLAND_DISPLAY='wayland-1' DISPLAY=':0'
[ImapModuleLoader] Using nsImapService.cpp
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: Could not connect to wayland display, WAYLAND_DISPLAY=(null) (t=0.205307) [GFX1-]: glxtest: Could not connect to wayland display, WAYLAND_DISPLAY=(null)
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: Could not connect to wayland display, WAYLAND_DISPLAY=(null) (t=0.205307) |[1][GFX1-]: More than 1 GPU from same vendor detected via PCI, cannot deduce device
 (t=0.205307) [GFX1-]: More than 1 GPU from same vendor detected via PCI, cannot deduce device

console.log: WebExtensions: windowEvent API started

I guess I'm missing a package and/or an environment variable, or something... Still, the exact same configuration was working with Thunderbird 115, so something has definitely changed in terms of requirement with Thunderbird 128. I'll try to figure this out.

nicolamori commented 3 days ago

I checked it again....Did it also yesterday already for Arch. Still working just fine. You need to use env GDK_BACKEND=x11 thunderbird.

It will give the "output"

Error: Failed to open Wayland display, fallback to X11. WAYLAND_DISPLAY='wayland-0' DISPLAY=':1'

and startup nicely.

And if you do not use the above, the plugin cannot control the TB window because wayland does not allow it (and/or has no API for it). Only X11 allows "external" control of windows.

I just tried and it does not work for me with Arch and Plasma. Thunderbird starts fine but systray-x icon does not show up. The console output is:

$ env GDK_BACKEND=x11 thunderbird
Error: Failed to open Wayland display, fallback to X11. WAYLAND_DISPLAY='wayland-0' DISPLAY=':1'
[ImapModuleLoader] Using nsImapService.cpp
JavaScript error: moz-extension://155dbbf5-d030-418e-9693-c8c993140c9f/background/index.js, line 4425: Error: Type error for parameter queryInfo (Unexpected property "discarded") for tabs.query.
Antiz96 commented 3 days ago

Hummm, so it seems like env GDK_BACKEND=x11 thunderbird doesn't work anymore for me since Thunderbird 128 but env MOZ_ENABLE_WAYLAND=0 thunderbird does work! :thinking:

So I just changed the Exec line in my .desktop file from Exec=env GDK_BACKEND=x11 thunderbird %u to Exec=env MOZ_ENABLE_WAYLAND=0 thunderbird %u and everything works as intended again.

I'm running Arch on Sway for what it's worth. @nicolamori can you try with MOZ_ENABLE_WAYLAND=0?

Antiz96 commented 3 days ago

From the official Thunderbird 128 release notes (under the "Linux" section):

Firefox now defaults to the Wayland compositor when available instead of XWayland. [...]

This basically means MOZ_ENABLE_WAYLAND=1 is set by default, preventing systray-x to start/work properly. The GDK_BACKEND=x11 method seems deprecated since Thunderbird 128, one should use MOZ_ENABLE_WAYLAND=0 instead now I think.

@Ximi1970 I assume the README should be updated accordingly (e.g. "When using Thunderbird 128+, use env MOZ_ENABLE_WAYLAND=0 thunderbird)

Antiz96 commented 3 days ago

Woops, I posted the release notes from Firefox instead of Thunderbird in my previous comment... :sweat_smile: But the point still stands though, Thunderbird 128 is effectively using Wayland by default: image

Antiz96 commented 3 days ago

I opened a merge request to document env MOZ_ENABLE_WAYLAND=0 thunderbird for Thunderbird 128+. I hope that helps :)

nicolamori commented 3 days ago

Hummm, so it seems like env GDK_BACKEND=x11 thunderbird doesn't work anymore for me since Thunderbird 128 but env MOZ_ENABLE_WAYLAND=0 thunderbird does work! 🤔

So I just changed the Exec line in my .desktop file from Exec=env GDK_BACKEND=x11 thunderbird %u to Exec=env MOZ_ENABLE_WAYLAND=0 thunderbird %u and everything works as intended again.

I'm running Arch on Sway for what it's worth. @nicolamori can you try with MOZ_ENABLE_WAYLAND=0?

env MOZ_ENABLE_WAYLAND=0 thunderbird does not work for me, I still don't get any icon in system tray.

Antiz96 commented 3 days ago

Hummm, so it seems like env GDK_BACKEND=x11 thunderbird doesn't work anymore for me since Thunderbird 128 but env MOZ_ENABLE_WAYLAND=0 thunderbird does work! 🤔 So I just changed the Exec line in my .desktop file from Exec=env GDK_BACKEND=x11 thunderbird %u to Exec=env MOZ_ENABLE_WAYLAND=0 thunderbird %u and everything works as intended again. I'm running Arch on Sway for what it's worth. @nicolamori can you try with MOZ_ENABLE_WAYLAND=0?

env MOZ_ENABLE_WAYLAND=0 thunderbird does not work for me, I still don't get any icon in system tray.

Are you using the systray-x-kde Arch package?

nicolamori commented 3 days ago

@Antiz96 Yes.

Antiz96 commented 3 days ago

@nicolamori Well, this is weird. I just installed Arch with KDE Plasma in a VM and both env GDK_BACKEND=x11 thunderbird and env MOZ_ENABLE_WAYLAND=0 thunderbird work on my side (while only the latter worked on Sway).

Antiz96 commented 3 days ago

I'll put my MR as a draft for now since it seems there are different behaviors depending on people and DE/Compositor.

nicolamori commented 2 days ago

I confirm that on my system it still does not work, but I found that despite having the 0.9.10 package installed:

$ pacman -Qs systray-x
local/systray-x-kde 0.9.10-1

the reported version on Thunderbird is 0.9.6: Screenshot_240916_094703

I removed and reinstalled systray-x-kde but nothing changed. Could this be the source of my problem?

@Antiz96 could this be a packaging issue? Should we move the discussion to the Arch Gitlab?

Antiz96 commented 2 days ago

I removed and reinstalled systray-x-kde but nothing changed. Could this be the source of my problem?

The fact that Thunderbird still sees version 0.9.6 is indeed most probably the source of your problem.

@Antiz96 could this be a packaging issue? Should we move the discussion to the Arch Gitlab?

At first glance, there's no reason for it to be a packaging issue. I use the Arch package myself and Thunderbird correctly reports the version on my side:

2024-09-16_07-53

Did you try to install the systray-x package from somewhere else that could conflict with the Arch package (AUR, manually, via the PKGBUILD/repo included in the README,...)?

nicolamori commented 2 days ago

I installed it from [extra] with pacman. I could try to uninstall and do a manual clean before reinstalling, but I'd need some guidance about what to delete.

Antiz96 commented 2 days ago

@Ximi1970 I think it's now clear that @nicolamori issue is specific and not related to env GDK_BACKEND=x11 (or MOZ_ENABLE_WAYLAND=0, even though I had to switch to that on my side with Thunderbird 128 and Sway). I guess my merge request can be closed (unless you still want to document the MOZ_ENABLE_WAYLAND=0 in the README? I can adapt it accordingly, if needed).

@nicolamori The fact that Thunderbird still sees systray-x at version 0.9.6 is definitely the cause of your issue, as support for Thunderbird 128.* in systray-x is only present since the 0.9.10 tag. Your systray-x install is most likely borked since a few times (but only caused breakages recently when Arch switched from Thunderbird 115 to 128). Now the mystery to solve is why Thunderbird still sees that old version of systray-x :stuck_out_tongue_closed_eyes: I've made some tests with the Arch package (both the -common and -kde versions) and both work fine and are detected properly as v0.9.10 in Thunderbird, so there's no packaging issue as far as I can tell. This is most likely a problem on your side (maybe an alternative installation way that conflicts with the extra package or something...). :shrug:

Antiz96 commented 2 days ago

I installed it from [extra] with pacman. I could try to uninstall and do a manual clean before reinstalling, but I'd need some guidance about what to delete.

Well, I think you tried that already but you can remove the package completely (pacman -Rns systray-x-kde), clean it from your cache (to force pacman to re-download it, rm /var/cache/pacman/pkg/systray-x-kde-0.9.10-1-x86_64.pkg.tar.zst*) and re-install it (pacman -S systray-x-kde). To be fair, I'll be surprised if this fixes the problem (unless you initially downloaded a borked version of the package somehow) as there's no packaging issue as far as I can tell. But worth a try I guess.

Some cleanup on the Thunderbird side could be worth a try also I guess.

(Also verifies that your system is fully up to date)

nicolamori commented 2 days ago

I removed the Arch package but systray-x was still present in Thunedrbird, so for sure I did something nasty in the past. Removing the extension and reinstalling the Arch package fixed everything (really everything: it works also when starting with env GDK_BACKEND=x11 thunderbird). Thanks to everybody for the help.

Antiz96 commented 2 days ago

I removed the Arch package but systray-x was still present in Thunedrbird, so for sure I did something nasty in the past.

Ha yeah, you most likely installed it from somewhere else in the past with some leftovers laying somewhere then.

Removing the extension and reinstalling the Arch package fixed everything (really everything: it works also when starting with env GDK_BACKEND=x11 thunderbird). Thanks to everybody for the help.

Cool, good to know :) You're welcome!

Antiz96 commented 2 days ago

@Ximi1970 I adapted the PR according to the above. Even though @nicolamori issue was in fact not related to GDK_BACKEND=x11 / MOZ_ENABLE_WAYLAND=0 at all in the end, I think it still doesn't hurt to document the latter in the README; as some people might face the same situation I faced with Sway (https://github.com/Ximi1970/systray-x/issues/199#issuecomment-2351796927).

Nikolai5 commented 2 days ago

Had same issue on Wayland KDE, resolved by setting MOZ_ENABLE_WAYLAND=0 environment variable in the launcher and in the autostart config.

Antiz96 commented 2 days ago

Had same issue on Wayland KDE, resolved by setting MOZ_ENABLE_WAYLAND=0 environment variable in the launcher and in the autostart config.

Were you using GDK_BACKEND=x11 before that?

Nikolai5 commented 2 days ago

Were you using GDK_BACKEND=x11 before that?

I was not, I also wasn't forcing Wayland either, so to be honest I don't know what Thunderbird was running under previously, I can only assume that due to the recent update forcing Wayland as default, it is now running under Wayland where it wasn't previously.

Antiz96 commented 2 days ago

Probably yeah... In any case, that confirms that MOZ_ENABLE_WAYLAND=0 is working and might be required for some people. I guess documenting it in the README doesn't hurt.