Betterbird / thunderbird-patches

Betterbird is a fork of Mozilla Thunderbird. Here are the patches that provide all the goodness.
Other
455 stars 20 forks source link

Minimise to tray not working on Linux if attempted before tray icon shows for the first time (workaround: set pref mail.biff.show_tray_icon_always). #227

Closed 3vi1 closed 8 months ago

3vi1 commented 8 months ago

Ubuntu (24.04 alpha) w/plasma-desktop packages. When using Wayland the minimize to tray icon doesn't seem to work.

The following is seen in the terminal. adding , and "" to the config does not get it to accept the null detected value.

Betterbird: Window NOT minimized to system tray! You are using desktop environment . Minimize to system tray is only supported for these desktops: kde,gnome,xfce,mate. As an experiment, add to preference mail.minimizeToTray.supportedDesktops. You might not be able to maximize the window again and will have to kill Betterbird. USE AT YOUR OWN RISK! If successful, contact support@betterbird.eu

Betterbird commented 8 months ago

Sorry, the previous reply (now deleted since totally wrong) came from the frustration of the never-ending zoo of Linux distros, desktops, versions, display technologies, etc. which are impossible to support.

Please check the environment variables. If they're not set, set them. If they're set and visible from the shell where you start BB, we wouldn't have a clue why the program can't read them.

UPDATE: The clue is that there is a logic error in the code, doh!

3vi1 commented 8 months ago

The environment variables are all set correctly on my system. Even putting the env command with the variables in the command to launch doesn't change the null ident bb spits out on the warning.

I copied the GetDesktopEnvironmentIdentifier function to a blank cpp project, changed the nsCString types to std strings to keep it simple, ran it, and it's returning 'KDE' in the line equivalent to 444 (which would be converted to lowercase by line 476) because that's what's in XDG_CURRENT_DESKTOP.

I took a quick look at the bb patches, and frankly I'm as puzzled as you as to why the desktop variable wouldn't have the correct value after your call into the mozilla::widget function.

I'm pulling the TB code now. If I have time tomorrow I'll look at debugging into it further to see what could be causing that behavior. I had only intended to look at BB for the tray functionality (which I agree, Linux DE devs haven't made easy for the app devs), but now I'm a little intrigued as to what's causing this particular issue.

Betterbird commented 8 months ago

We have a script to build BB from scratch: https://github.com/Betterbird/thunderbird-patches/blob/main/build/build.sh

It's documented "a little" here: https://github.com/Betterbird/thunderbird-patches/blob/main/README.md

Betterbird commented 8 months ago

OK, looks like we messed it up in this patch: https://github.com/Betterbird/thunderbird-patches/blob/bdec93f5e379db4a91ae2ed5949c76e1732f16d9/115/features/13-feature-linux-systray-mate.patch#L112 https://github.com/Betterbird/thunderbird-patches/blob/bdec93f5e379db4a91ae2ed5949c76e1732f16d9/115/features/13-feature-linux-systray-mate.patch#L139 Sigh.

The desktop is put into a static when the indicator is created, but that's too late when you use minimise to tray. You can work around it by setting pref mail.biff.show_tray_icon_always or by making sure that the indicator shows at least once (by getting new mail) before you minimise to tray.

Now that's really embarrassing after ranting about the Linux mess (which is still true). Apologies!

We'll correct it within 24 hours from now.

3vi1 commented 8 months ago

Oh cool - you spotted it! Thanks for sharing so quickly; that saved me from hunting it down tomorrow.

No worries about the ranting. I've written/supported cross-platform projects before, and I know what a pain it can be to track down problems on alternate systems/configurations.

Betterbird commented 8 months ago

Should be fixed here now: https://www.betterbird.eu/downloads/LinuxArchive/betterbird-115.5.1-bb19-latest-build2.en-US.linux-x86_64.tar.bz2

3vi1 commented 8 months ago

Tested and confirmed working now!

This looks like a slam-dunk replacement for Thunderbird users who were using birdtray on X11 (which doesn't work for me no matter how I override the variables in Wayland). Thanks for the quick resolution!

Betterbird commented 8 months ago

Thanks for insisting. Note: https://www.betterbird.eu/releasenotes/