-
Notifications
You must be signed in to change notification settings - Fork 22
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
Support "minimise to tray" on Linux #111
Comments
Yes, I actually got to know about Betterbird when I was looking for good alternatives for Thunderbird closing to tray on linux. MinimizeToTray Reanimated has versions that work with Thunderbird 60.0 - 63.*, I think it is not maintained anymore. I used to use Birdtray, but had some issues with it. I am currently using SysTray-X, and it is fine on X11 but does not work on Wayland. Since now we have a tray icon that is working properly on Linux systems, I wish that Betterbird could support close to tray. It seems more attainable now.
|
So we've made a start here: Sadly we ran into AyatanaIndicators/libayatana-appindicator#4: We'll see how this can be solved in libayatana-appindicator. |
How about adding a menu instead with a "Show/Hide" button? That was working out even for GNOME in the official appindicator demo. |
Well, any additional text strings bring localisation issues. Two clicks instead of one are also clumsy and they are also different to what the Windows version does. Yes, people have been adding menus to work around the non-ability of getting the clicks, see here for example: We're in a better position: We use a fork of the library, so with the right knowledge (which we don't have) we could just add code for the click event. |
I landed here after installing Betterbird on linux and finding out there is still active development in trying to make a systray fully work (thanks!). I will just leave my comment here for anybody else that is in my same situation and immediately wants something that gives at least some basic functionality: gyunaev/birdtray fully works with Betterbird, once you set the correct path to the betterbird executable and use |
Yes, we have a patch that works in minimising the windows to the tray: We made an effort here https://bugs.kde.org/show_bug.cgi?id=465438 to get some idea on how to implement that, so far to no avail. We need to start an initiative on one of the KDE mailing lists as suggested in the bug, [email protected]. |
I found that the Qt library provides the QSystemTrayIcon Class https://doc.qt.io/qt-6/qsystemtrayicon.html, which provides an icon for an application in the system tray.
It has an "activated" signal which gives an "ActivationReason", which can be of type "QSystemTrayIcon::Trigger": The system tray entry was clicked |
@Betterbird do You know the KDocker? I'm using it to provide a tray icon to Betterbird and Thunderbird. Maybe You can use something from the KDocker code to provide a decent solution. |
Thanks for the suggestion. We're using AyatanaIndicators/libayatana-appindicator, and that's not moving forward, see latest comment here: |
KDocker does not support Wayland atm, so it’s not very future-proof. I would rather repeat my suggestion: QSystemTrayIcon. I understand that it would take some work to replace the existing code that uses libayatana-appindicator though. |
Activation support for system tray icons has arrived, see AyatanaIndicators/libayatana-appindicator#71. Sadly it's only working for KDE, so we can implement "minimise to tray" on KDE only. Thoughts? Anyone willing to test? |
I'm willing to test this on KDE |
Thanks, I'll get it done in the next 48 hours. We already have a patch that is 95% complete: |
OK, like on Windows, you can now enable this under "System Integration": We tested the minimise part, we can't test the restore part since we currently don't have KDE. It's possible that it crashes on restore, that is, click onto the system tray icon after minimising it. If it's not minimised, a click onto the system tray icon should just bring the window to the foreground. Please run Betterbird from a terminal window, if it doesn't even mininise to tray, it will tell you why. P.S.: In case anything works, does a maximised window get restored as non-maximised? That could be fixed. |
Thank you for that. It works. The only catch is that I have to click twice on the icon before the window is actually restored. It seems that the first time it tries to restore but then immediately goes back to tray. The second time, the window is restored fine. PS: with the extension "Minimize on Close", we also get the same behavior on close: close to tray, which is nice PPS: my first test and video were in X11. It also works the same in Wayland PPPS: yes, maximised window get restored as non-maximised |
Thanks for testing. I can't see the "first time it tries to restore but then immediately goes back to tray", maybe it's not captured in the video. There was a question you didn't answer: If it's not minimised, a click onto the system tray icon should just bring the window to the foreground. But I realise that for testing that, you need to set pref mail.biff.show_tray_icon_always first. Looks like I have to get a KDE desktop somehow 😞. P.S.: OK, got a KDE desktop now. So yes, if not minimised, a click on the "always on" icon activates the window. That's good. I can also see the "failed" attempt to restore which is not in the video. |
It works perfectly in KDE on X11 and Wayland. Just one question: is there an option to start betterbird minimized in the tray? |
Yes, set pref mail.startupMinimized (no UI for that one). In our testing that also works, but we've just made another tweak to make it more stable. Let me know if it doesn't work and I'll send another binary. |
I'll also leave my 2 cents here. Disclaimer: I know it should only work for KDE but I tried it with GNOME explicitly (by adjusting the config value). Even if there are no tooltips for GNOME I'd like to have this as feature. Here is a desktop recording:
|
Gotta love those different desktops. Did the first version ever restore the window without having to click on the taskbar? We changed the code to restore the window, the first code was more Gtk-ish, so perhaps this works better. The aim is to ship this in 115.2.0 in a few days, so there's not much time for experiments. I can compile a "take 3" later on for you to check. P.S.: what string did you add to the pref? "gnome" or something longer? |
The first one was very unreliable as I said, so I can't really tell you what it did when 😄 |
If I see it correctly, Wayland isn't fully supported by the Mozilla platform, see all the "Depends on" in this meta bug: That the window doesn't minimise is due to the fact that internally a "sizemodechange" is not received. We debugged this with another BB user, who in the end reported this upstream bug: You can repeat the steps in the description of this bug, that is, paste |
Yeah it doesn't print anything :/ |
This doesn't seem to work on tiling window manager (namely, XMonad). Clicking the icon does not do anything, closing the window, well, closes Betterbird instead of minimizing to tray. Welp, back to Thunderbird then. |
Do you use Wayland? Anyway, TB doesn't offer the feature. |
Nope, plain old X11. |
What you write is rather irritating. Yes, BB does offer system tray support incl. minimise to tray on known configurations and it's also documented at https://www.betterbird.eu/expert-tips/ System Tray support (Windows and Linux)The following is supported:
"Minimize to tray" on Linux from version 102.5.0 and 115.2.0. 102.5.0 only supports KDE and Gnome. (*) For Gnome you need to install the "AppIndicator and KStatusNotifierItem Support" extension. Double-click to activate. Relevant preferences:
You will understand that it's impossible to support all possible Linux variations. Which desktop are you using and have you started BB from the command line to see which desktop it reports. If that's not in the list of supported desktops, it won't work. |
@Betterbird He just means, "Since it's not working for me, and this is the only feature I needed, I'll stick with the unpatched Thunderbird for now". 🙂 |
I know what he means. But it's written as a threat "back to Thunderbird then" and a false statement "neither does BB". |
@Betterbird I'm sorry I've offended you, I was just stating the fact that I'm not going to use your product since it does not work for me and, I guess, for a whole lot of professional Linux users since tiling window managers occupy a lot of places in the lists of most popular desktop environments, e.g. this one — it even has one on 2nd place. |
First of all, there is some confusion here. For system tray and minimise to tray to work, your Linux desktop needs to provide a system tray. As you can see in #111 (comment), some desktops support this, Gnome only after an additional software installation. Reading https://askubuntu.com/questions/18078/what-is-the-difference-between-a-desktop-environment-and-a-window-manager, there is a difference between desktop and windows manager. We're running Xfce with xfwm4, KDE with KWin, Mate with Metacity and Gnome with "GNOME Shell". The system tray support depends on the desktop environment. That's why BB on Linux, when run from the command, line reports the DE is has detected. Why don't you read the comment above again, run BB from the command line and see which DE it reports? You can add the DE name string to pref BTW, your comment #111 (comment) is unclear. Which icon do you click? The close button will always close the application. And minimise to tray needs to be enabled via an option. Over to you to provide the necessary details instead of a "doesn't work". |
@lockie Tray functionality sucks because it's implemented via GTK3 - and we can't change this because that's what Thunderbird uses. And GTK3 is that famous one when the Gnome devs decided that they have their vision for the future of desktop computing, and that future does not have trays at all (and made Gnome 3). 😵💫 So the only way to have an icon is to use something called libayatana-appindicator, which does not make things easy either. And on top of all that, each DE has their own tray implementation... and there are multiple different protocols... If you are curious to see what we had to go through to make this work at all, and pick up where we left, there are a few issues around the time of this one (numbered something about 100-111 IIRC). There's even a minimal test source to fiddle around with. There are a couple different issues for different DEs, so we had to implement an option to switch between the behaviour that doesn't work on KDE and the one that doesn't work on MATE. 😵 So if you can figure out how to get tray icons working in your DE, and it doesn't break the other ones too much, then it could potentially be added as well. (I'm not a core dev though - I just did the same for MATE to get it working for me. 🙂 ) |
Right. Since competition is good for business, the TB folks have now started to implement something themselves: Good luck to them. |
Right, I wasn't providing enough details. I'm using polybar panel to display a system tray. Betterbird correctly identifies my desktop as xmonad, and I already have added it to |
Then that's the problem. @Betterbird refuses to make it minimize on tray icon click, in order to keep the behaviour consistent with Windows, so if you don't have a way to issue a "minimize" command normally, there's no other way to do it. I do remember some discussion about minimizing instead of closing, but I don't remember @Betterbird 's position on it... |
Hmm, not enough details. You haven't stated whether "minimise to tray" is actually selected as an option: You've added Next you talk about "the icon", but there are several, at least one to minimise and one to closes. With the add-on https://addons.thunderbird.net/en-us/thunderbird/addon/minimize-on-close/ you can change the action of the close icon, the app will minimise instead, but then again, I don't know whether minimise means anything in you wm. |
The Minimize on close addon looks promising, but it does nothing on a WM - the window just blinks and then reappears again. |
Look like your system is just too different for anything to work. We
don't have the resources to analyse it. Likely it's a problem in the wm
anyway.
Let's see whether TB's own system tray support will work better when they
ship it in 2026.
|
I see that this thread is old, but a alive. I too can't get system tray support to work. Here are my settings: Any my betterbird version: I'm using NixOS (Thanks to https://cache.nixos.org/log/q6cw2g05v27jypqyni60rpnzvdjsp11i-betterbird-unwrapped-115.9.0.drv On the contrary, the flatpak version of this does show the systray, and together with minimize-on-close the experience is perfect. Still I'd like to get this working natively on NixOS. |
I think that if the FlatPak works but the NixOS build doesn't then that wasn't built correctly. Hard to say. Have you tried our binary release (.tar.bz2 files)? Looks like these patches
I don't know how the patches are applied, let's assume the patches all applied and only the process is more noisy. |
@Betterbird I suspect that this is related to Ayatana dependency not available during the build. For sure our package |
No. We include the library ourselves. |
This is how we do it: |
OK, the Other than that, I can't tell why the system tray stuff doesn't work. |
Maybe @SuperSandro2000 will have a clue 🙏. |
The minimize option doesn't seem to work right on Linux Mint 22 Cinnamon edition either. I've installed Betterbird via the Software Manager (Flathub), and with the option on minimizing leaves the app on the bar instead of moving it to tray. |
Cinnamon doesn't work:
http://www.betterbird.eu/expert-tips/
Thanks for confirming.
|
Ah, I see! Is this a limitation with the distro, or is it something that could potentially be fixed in future updates? |
No intention to work around quirks of the various desktops. It works for
KDE, Gnome, Xfce and Mate, and Mate was already a pain to get working.
Besides, the TB folks have just implemented their own system tray support
written in Rust:
https://github.com/thunderbird/linux-sys-tray
https://github.com/thunderbird/dbus_hooks
Let's see how well this works, it only mentions KDE and Gnome.
Ideally we can scrap the Betterbird implementation at some stage.
|
From #20 (comment):
Check this question and this answer. It's now tracked here:
https://bugzilla.mozilla.org/show_bug.cgi?id=1627479
Getting the indicator in the systray (Issue #20) was hard enough and still doesn't work fully on Gnome. Hiding the taskbar "button" to instead show the icon seems even harder. Or is there some API that can do it? Or maybe the code from this add-on https://addons.thunderbird.net/en-GB/thunderbird/addon/minimizetotray-reanimated/ could be used.
The text was updated successfully, but these errors were encountered: