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

Adding show/hide support for full Wayland #426

Open
gyunaev opened this issue Oct 25, 2020 · 22 comments
Open

Adding show/hide support for full Wayland #426

gyunaev opened this issue Oct 25, 2020 · 22 comments
Labels
enhancement New feature or request

Comments

@gyunaev
Copy link
Owner

gyunaev commented Oct 25, 2020

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:

  • Birdtray cannot detect whether Thunderbird is running, and thus cannot start/restart it;
  • Birdtray cannot hide and show Thunderbird;

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.

@gyunaev gyunaev added the enhancement New feature or request label Oct 25, 2020
@gothmog123
Copy link

gothmog123 commented Mar 31, 2021

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
Copy link

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
Copy link

Flying--Dutchman commented Aug 15, 2022

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
Copy link

aacebedo commented Dec 6, 2022

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

@BrianTipton1
Copy link

BrianTipton1 commented Jan 7, 2023

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

@fadialzammar
Copy link

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
Copy link

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
Copy link

AuntStef commented Feb 27, 2023

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
Copy link

mlgomez commented May 26, 2023

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
Copy link

Drek282 commented Sep 19, 2023

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
Copy link

that's not work when thunderbird when is wayland native

@Zahrun
Copy link

Zahrun commented Sep 19, 2023

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

@alphaonex86
Copy link

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
Copy link

Drek282 commented Sep 19, 2023

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
Copy link

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
Copy link

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
Copy link

szw0407 commented Mar 28, 2024

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
Copy link

szw0407 commented Mar 28, 2024

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
Copy link

szw0407 commented Mar 28, 2024

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
Copy link

cgarz commented Apr 10, 2024

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
Copy link

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): Betterbird/thunderbird-patches#279
This means that the text will be blurry if you use upscaling.

@antrmn
Copy link

antrmn commented May 30, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests