gyunaev / birdtray

new mail system tray notification icon for Thunderbird
GNU General Public License v3.0
792 stars 60 forks source link

Adding show/hide support for full Wayland #426

Open gyunaev opened 3 years ago

gyunaev commented 3 years ago

At this moment Birdtray works fine with "wayland" desktop which also runs embedded X Server. However Birdtray does not work in so-called "full wayland" support, without the X Server.

The main limitation is that Wayland provides no standard way to figure out which other top-level windows are being shown. This in turn means Birdtray cannot interact with them. This impacts the following functionality:

Those limitations will not be fixed until Wayland fully implements the Wayland Toplevel Management protocol which is currently unstable and not implemented by KDE or Gnome window managers. The only possible current alternative is to integrate directly with each window manager, but considering the number of them, this is not a viable alternative. Thus the full Wayland support is still pending on when this specification a) becomes stable and b) becomes implemented.

The email monitoring and showing functionality works fine, however.

gothmog123 commented 3 years ago

there aren't many properly working wayland window managers - some would say it's only sway and gnome. so you wouldn't have that many targets if you wanted to implement it individually

aindriu80 commented 2 years ago

I am having the same Wayland problem, I am running Pop OS 22.04 and just switched to Wayland on the login screen. When I logged in birdtray started up but it couldn't minimize Thunderbird, is there any way of getting birdtray to work with Wayland?

Flying--Dutchman commented 2 years ago

For the time being, a simple workaround is to start birdtray with x11 session if possible. Simply execute the following command to start birdtray: XDG_SESSION_TYPE=x11 birdtray

aacebedo commented 1 year ago

not working here on my side even with the env variable set

BrianTipton1 commented 1 year ago

I had to use env -u WAYLAND_DISPLAY birdtray and it works as expected under XWayland on KDE Plasma

fadialzammar commented 1 year ago

I was able to get around this by launching Thunderbird as an X11 app through XWayland. Birdtray was already running under X11 for me by default, but if not you can follow @Flying--Dutchman's solution.

Modify /usr/share/applications/thunderbird.desktop, changing Exec=thunderbird (I had 3 spots in the file with this that I changed) to Exec=env GDK_BACKEND=x11 thunderbird.

Then in Birdtray, go to Settings, Advanced, and in "Thunderbird command line" change it from /usr/bin/thunderbird to /usr/bin/env GDK_BACKEND=x11 /usr/bin/thunderbird.

soumyaDghosh commented 1 year ago

I was able to get around this by launching Thunderbird as an X11 app through XWayland. Birdtray was already running under X11 for me by default, but if not you can follow @Flying--Dutchman's solution.

Modify /usr/share/applications/thunderbird.desktop, changing Exec=thunderbird (I had 3 spots in the file with this that I changed) to Exec=env GDK_BACKEND=x11 thunderbird.

Then in Birdtray, go to Settings, Advanced, and in "Thunderbird command line" change it from /usr/bin/thunderbird to /usr/bin/env GDK_BACKEND=x11 /usr/bin/thunderbird.

Using this, it'll open thunderbird from the tray as expected, but if we use the thunderbird icon in app menu, it'll not work anymore

AuntStef commented 1 year ago

Using this, it'll open thunderbird from the tray as expected, but if we use the thunderbird icon in app menu, it'll not work anymore

Try changing the Thunderbird launch command to birdtray -s. Seems to work well for me.

Edit: I'm also using the plugin Minimize on Close.

mlgomez commented 1 year ago

I was able to get around this by launching Thunderbird as an X11 app through XWayland. Birdtray was already running under X11 for me by default, but if not you can follow @Flying--Dutchman's solution.

Modify /usr/share/applications/thunderbird.desktop, changing Exec=thunderbird (I had 3 spots in the file with this that I changed) to Exec=env GDK_BACKEND=x11 thunderbird.

Then in Birdtray, go to Settings, Advanced, and in "Thunderbird command line" change it from /usr/bin/thunderbird to /usr/bin/env GDK_BACKEND=x11 /usr/bin/thunderbird.

Using this suggestion I was able to get it kind of, sort of working. My issue here is that it works only once, and then I can't show/hide by clicking the application tray icon unless I go into Settings--not changing anything, just opening the dialog--and clicking "OK." Once that's done, I've "reloaded" it like a shotgun to work again one more time lol.

I have to remember each time I use the tray icon to open the Settings window again to ensure that it's loaded up for the next time.

Also, if I open Thunderbird from the wm/de, and then close it, birdtray will just open it again and refuse to hide it. Doing this also makes the "Open settings and close it" trick no longer work. It's just stuck and constantly reopening Thunderbird, refusing to hide it.

Interestingly enough, typing "birdtray -s" and then "birdtray -H" in the terminal resets everything. In addition to this, typing "birdtray -s" in terminal and then clicking the app icon in tray also hides it properly.

Maybe this information is helpful to someone?

Using this, it'll open thunderbird from the tray as expected, but if we use the thunderbird icon in app menu, it'll not work anymore

Try changing the Thunderbird launch command to birdtray -s. Seems to work well for me.

Edit: I'm also using the plugin Minimize on Close.

On this I am not sure what you mean. Can you clarify? Are you talking about editing the Exec line in the .desktop entry in /usr/share/applications/thunderbird.desktop ?

Drek282 commented 1 year ago

For the time being, a simple workaround is to start birdtray with x11 session if possible. Simply execute the following command to start birdtray: XDG_SESSION_TYPE=x11 birdtray

Thank you so much. This worked for me on Debian bookworm. You can either edit the menu entry for birdtray, or use a script to start it.

alphaonex86 commented 1 year ago

that's not work when thunderbird when is wayland native

Zahrun commented 1 year ago

Betterbird now has a working systray on linux, included on Wayland https://github.com/Betterbird/thunderbird-patches/issues/111 https://www.betterbird.eu/releasenotes/index.html https://www.betterbird.eu/downloads/index.php https://www.betterbird.eu/donate/index.html

alphaonex86 commented 1 year ago

Betterbird now has a working systray on linux, included on Wayland Betterbird/thunderbird-patches#111 https://www.betterbird.eu/releasenotes/index.html https://www.betterbird.eu/downloads/index.php https://www.betterbird.eu/donate/index.html

not simple download source and build..., problem into build from source instruction. not integrated into my debian, I try never use package out of my debian

Drek282 commented 1 year ago

For the time being, a simple workaround is to start birdtray with x11 session if possible. Simply execute the following command to start birdtray: XDG_SESSION_TYPE=x11 birdtray

Thank you so much. This worked for me on Debian bookworm. You can either edit the menu entry for birdtray, or use a script to start it.

On Debian bookworm you may need to ensure that kwin-wayland is installed.

Grant12311 commented 11 months ago

Is there any actual progress being made on this? I rely on this project heavily so I'll gladly lend a hand on this if so or start on it myself if not.

aindriu80 commented 10 months ago

I got it working for the most part, go to Birdtray settings - Advanced and enter the following in the command line

/usr/bin/env GDK_BACKEND=x11 /usr/bin/thunderbird

of course, your install location may be different. There might have been something else to do but try birdtray out in the terminal, the error messages will help

szw0407 commented 6 months ago

May it be possible to check the whether thunderbird is running via the system process status?

For example, when running birdtray, it automatically starts a headless thunderbird. When another thunderbird tries to launch, more processes of thunderbird launches, then the headless thunderbird automatically shuts down to let the GUI launch. When later the GUI is closed, birdtray starts a new headless thunderbird.

Does it make any sense? If so, no matter wayland of xorg, it will work. It shall not consume too much resource compared with the checking window existence.

Anyway, I simply dislike xwayland, as it has terrible performance under high-DPI and I believe that it should not be used unless you have to.

szw0407 commented 6 months ago

I have tested that usually thunderbird headless mode will only have a certain number of processes, including some started by extensions.

Thus, if much more processes are started, we can suppose the user wants to start the GUI through, for example notification, desktop file, a mailto link or something else. In this occasion, I have tested that if the headless thunderbird is terminated about 0.5 seconds after the usual thunderbird is started using bash, it will not have any effects to the later; but if it is still running, the later won't start GUI but shows an error, something like that there is already a running thunderbird, which may be not responding and you need a reboot.

Thus, I suppose that the ps command or something like that is useful.

I have not yet tested the Flatpak or snap or Appimage of thunderbird, but I suppose them to be similar.

szw0407 commented 6 months ago

The headless one is very easy to be found via ps as it must have --headless behind the thunderbird-bin, but if launched using another method, it will not have this. Will anyone usually use thunderbird, or any usually seen programs call thunderbird in a headless way? I have not yet known.

cgarz commented 5 months ago

Betterbird now has a working systray on linux, included on Wayland [...]

KDE on Arch recently moved to wayland by default which broke it for me too. Thanks for mentioning betterbird, it seems to be a much better solution than birdtray anyway. Especially with close to tray which was also mentioned here.

tbertels commented 4 months ago

Betterbird now has a working systray on linux, included on Wayland Betterbird/thunderbird-patches#111 https://www.betterbird.eu/releasenotes/index.html https://www.betterbird.eu/downloads/index.php https://www.betterbird.eu/donate/index.html

BTW: Anyone, like me, who wanted Wayland support for this to get Birdtray or some other Thunderbird add-on working should go check out BetterBird. It's a set of patches on top of Thunderbird which include a tray icon that works in both X11 and Wayland.

Betterbird's minimize to tray feature doesn't actually work on Wayland in Wayland mode (with Exec=env MOZ_ENABLE_WAYLAND=1): https://github.com/Betterbird/thunderbird-patches/issues/279 This means that the text will be blurry if you use upscaling.

antrmn commented 4 months ago

Good news: sys tray support for Thunderbird on Linux is in development.

https://connect.mozilla.org/t5/ideas/system-tray-support-on-linux/idc-p/55780/highlight/true#M32692