Betterbird / thunderbird-patches

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

Tray icon clicking not opening Betterbird, KDE 5.27.4 and 5.27.8 #209

Closed code2be closed 11 months ago

code2be commented 11 months ago

Hello,

I've got the new update ( 115.3.1-bb14 ) on ( Ubuntu 23.04 ) running ( plasmashell 5.27.4 ).

After activating the option of minizing to tray, I cannot restore the window although clicking the tray icon. I've been capable of that in the previous version before this specific update.

Thank you.

Betterbird commented 11 months ago

Thanks for the report. Looks like a change we made in the last release needs to be reverted, the "present with time". @dark-penguin, please take note.

I'll compile a new version in a few hours.

dark-penguin commented 11 months ago

I don't believe it's that one - it could show the window non-focused, but one thing it absolutely can not do is not show the window at all. Could you build a version without that patch for them to try first?

dark-penguin commented 11 months ago

If that's the version with today's SNI patch, try reverting that instead.

Betterbird commented 11 months ago

The non-functioning version released two days ago doesn't have yesterday's patch. So the only change from previous versions is the "with time". Maybe it's ignored since it's a fantasy time stamp.

dark-penguin commented 11 months ago

So that was the only change between those versions? I think he may be talking about a previous version he had, not the previous version specifically. Maybe he could try the proper "previous version" to confirm that it fixes the problem?

dark-penguin commented 11 months ago

...And if it is a problem indeed, then we could probably try doing present() followed immediately by present_with_time(), or the other way around. That should satisfy all conditions.

dark-penguin commented 11 months ago

Come to think of it, the new non-SNI support fix could help with this, so maybe try that first?

Betterbird commented 11 months ago

OK, we're talking about two versions, one with build ID of 29/9, the official 115.3.1-bb14, and one from yesterday, 30/9 with an additional activation fix in libayatana-appindicator as can be seen in issue #208. I've tested both version with my KDE Plasma 5.18.8 and both activate as before.

Next I tried the two versions on Mate, and as we learned from #208, the additional fix now lets me activate.

@code2be, please try the version from 30/9 which you can find here: www.betterbird.eu/downloads2/betterbird-115.3.1.en-US-bb14-additional-activation.linux-x86_64.tar.bz2 See https://github.com/Betterbird/thunderbird-patches/issues/208#issuecomment-1741835463.

The question is whether for newer KDE versions we need to revert the change we made in 115.3.1-bb14 where we switched activation from gtk_window_present() to gtk_window_present_with_time() for better activation on Mate. If nothing else, we need to let the user select the activation call via a pref or in fact make both calls 🤮.

Betterbird commented 11 months ago

Come to think of it, the new non-SNI support fix could help with this, so maybe try that first?

Why? The way BB activates the window hasn't changed, there are just more events flying around that can trigger the same activation.

dark-penguin commented 11 months ago

Why? The way BB activates the window hasn't changed, there are just more events flying around that can trigger the same activation.

I think what's changed is that for some reason, in this case the Plasma tray application switches to the non-SNI mode, and in that mode clicks don't make it through. That's more likely than present_with_time() not presenting the window at all.

I've tried the latest BB version (with both my fix and the SNI fix) on a Manjaro LiveCD, with plasmashell 5.27.8 . Clicking the icon restores the window just fine. Right-clicking it does nothing, as it probably should, but it might be an indication about the mode it's running in.

Betterbird commented 11 months ago

OK, here we go:

Official version 115.3.1-bb14, 29/9, using GTK "with time" call, no additional activation fix for Mate, etc: https://www.betterbird.eu/downloads/get.php?os=linux&lang=en-US&version=release

Version of 30/9: using "with time", with additional activation fix for Mate (Issue #208): http://www.betterbird.eu/downloads2/betterbird-115.3.1-bb14-additional-activation.en-US.linux-x86_64.tar.bz2 (sorry, the name was wrong before, so I changed it now)

Version of 1/10: not using "with time", with additional activation fix for Mate: http://www.betterbird.eu/downloads2/betterbird-115.3.1-bb14-additional-activation-not-with-time.en-US.linux-x86_64.tar.bz2

So, @code2be do these last ones work better for you?

code2be commented 11 months ago

Thanks for your support and quick responses.

@Betterbird Confirmed, the latest version ( 1/10 not-with-time ) is working smoothly, window restored once clicked the tray icon.

Betterbird commented 11 months ago

OK, thanks for testing, we'll work out something for the next release. Note that that version has a regression and messages open blank in the stand-alone message window if you have them configured not to open in a tab. We'll address this soon.

code2be commented 11 months ago

@Betterbird Thanks for clarifying this. I'll be ready for further tests if you need.

Betterbird commented 11 months ago

Well, the change that breaks your setup was suggested by @dark-penguin to fix an issue on his Mate: We've changed the GTK call gtk_window_present() to gtk_window_present_with_time(), albeit with a fantasy time stamp. Apparently it improves the situation on Mate.

We don't quite understand what's happening on KDE since even with the "with time" call, activation works for the KDE versions we tried, 5.18.8 and 5.27.8. So why would 5.27.4 be different? Perhaps it has an issue that was later corrected?

dark-penguin commented 11 months ago

I think it has to do with a specific setup - I've tested it on Debian and Manjaro as two polar opposites, and it worked both times. @code2be , does your distribution have a LiveCD to reproduce the problem with? That's what I usually do: if a problem can be reproduced on a LiveCD, then it's a problem anyone can see. If it's not, then I look for differences between the LiveCD and my system, until I find what causes the problem. (Now I see one instance where NixOS would shine...)

@Betterbird I'm fine with introducing a config option, but wouldn't that be too much added complexity for a fix? That's why I suggested trying both ways to "present" at the same time - first, the normal one to restore the window, and then the second one to activate it. Maybe also take a look at... there was some additional code that "KDE requires" that seems suspicious to me. But this is hard to do when we can't reproduce the problem ourselves =/

Betterbird commented 11 months ago

We'll work something out. Yes, another pref is ugly, but so are two almost identical calls.

dark-penguin commented 11 months ago

At least two calls do not require user interaction (and awareness). But I'm not sure two calls will work, either :) Getting through focus steal prevention is one thing, but how could it affect showing the window...

ArtyIF commented 11 months ago

Can confirm the bug on Flatpak on Fedora 38 with Plasma 5.27.8

Off-topic: great timing for me to download something when the feature I download it for is broken lol

dark-penguin commented 11 months ago

@ArtyIF So in https://github.com/Betterbird/thunderbird-patches/issues/209#issuecomment-1742174820 , only the third one works, and neither of the first two do?

Betterbird commented 11 months ago

Off-topic: great timing for me to download something when the feature I download it for is broken lol

Haha. Sorry, but that Linux stuff is just a mess. Get a Windows PC and there won't be an issue, lol. Seriously, you can't cater to everyone and no one would have assumed that switching one GTK call to another will cause such strife.

http://www.betterbird.eu/downloads2/betterbird-115.3.1-bb14-additional-activation-not-with-time.en-US.linux-x86_64.tar.bz2 will work, if you use stand-alone windows, I can do another build with this fixed, too.

ArtyIF commented 11 months ago

Yep, the 1/10 version works

code2be commented 11 months ago

OK @dark-penguin, I'm going to have a fresh setup on a VM, to give it a try. I don't use Live CD, My current setup is based on Ubuntu, while I did remove Gnome and installed Plasma myself time ago. To be specific, I'm going to setup Kubuntu 23.04 using the ISO from https://kubuntu.org/getkubuntu/ on a VM.

dark-penguin commented 11 months ago

@code2be We just got a report that it failed on a Fedora 38 with the same version I had on Manjaro - so you are not the only person affected. I'll try it on a Fedora 38 LiveCD, and see if I can catch it this way. I can also try your Kubuntu.

code2be commented 11 months ago

@code2be We just got a report that it failed on a Fedora 38 with the same version I had on Manjaro - so you are not the only person affected. I'll try it on a Fedora 38 LiveCD, and see if I can catch it this way. I can also try your Kubuntu.

OK Great, I'll update you with my test result on Kubuntu once done.

Betterbird commented 11 months ago

We have two users on more modern versions of KDE where the app doesn't activate any more due to the gtk_window_present_with_time() call.

So I think this call will be reverted to what it was before, gtk_window_present() since that worked for everyone, albeit didn't always activate to the foreground on MATE.

Interested users will be able to trigger the "with time" behaviour via a pref. Either we make it:

pref("mail.minimizeToTray.supportedDesktops", "kde,gnome,xfce,mate");
pref("mail.minimizeToTray.activateWithGtkPesentWithTime", false);

or

pref("mail.minimizeToTray.desktopsWithGtkPesentWithTime", "mate");

So people can add their desktop to that pref or remove it to change the behaviour. And with luck, the default value will "just work"(TM).

dark-penguin commented 11 months ago

It opens the window just fine on stock Fedora KDE 38. Both of them do - no focus problems in the old one either. I guess there is some kind of popular setting that changes something. Or maybe my test profile is too tuned to work properly on everything. :)

pref("mail.minimizeToTray.desktopsWithGtkPesentWithTime", "mate");

That's actually a great idea! This way, it would work by default, and be possible for users to quickly fix if they have an unexpectedly non-working situation! :)

code2be commented 11 months ago

OK, here we go:

Official version 115.3.1-bb14, 29/9, using GTK "with time" call, no additional activation fix for Mate, etc: https://www.betterbird.eu/downloads/get.php?os=linux&lang=en-US&version=release

Version of 30/9: using "with time", with additional activation fix for Mate (Issue #208): http://www.betterbird.eu/downloads2/betterbird-115.3.1-bb14-additional-activation.en-US.linux-x86_64.tar.bz2 (sorry, the name was wrong before, so I changed it now)

Version of 1/10: not using "with time", with additional activation fix for Mate: http://www.betterbird.eu/downloads2/betterbird-115.3.1-bb14-additional-activation-not-with-time.en-US.linux-x86_64.tar.bz2

So, @code2be do these last ones work better for you?

Just tried version 30/9 "with time" on Kubuntu 23.04 using plasmashell 5.27.4 on a fresh-install VM, and it worked without any issues !, the tray icon is restoring the window smoothly !

CC @dark-penguin

Betterbird commented 11 months ago

And the release version of 29/9 works there, too, right?

dark-penguin commented 11 months ago

Installing a system is too much hassle - you can try it on the LiveCD iself, with a VM. And it works - on any system I could try.

So I guess there is some setting that apparently a lot of people use, that breaks it. Maybe derived from an old configuration? But finding that may be tricky.

ArtyIF commented 11 months ago

Just checked, 29/9 works for me too

code2be commented 11 months ago

And the release version of 29/9 works there, too, right?

Confirmed, working smoothly on the fresh-install VM.

code2be commented 11 months ago

Installing a system is too much hassle - you can try it on the LiveCD iself, with a VM. And it works - on any system I could try.

So I guess there is some setting that apparently a lot of people use, that breaks it. Maybe derived from an old configuration? But finding that may be tricky.

You're right, and I did use the Kubuntu Live CD on the VM. Also, I agree regarding how tricky it is to find the cause of my issue, but will try figure out that.

felixoi commented 11 months ago

I didn't read the full conversation but I checked the minimization to tray and calling it back to front from tray for all three provided versions. They all behave the same on GNOME

Betterbird commented 11 months ago

Thanks! There are subtle differences which don't affect you, neither do they affect the Xfce I tested. And even on a fresh KDE install there aren't any differences, however, the ticket is about some of them not working on KDE under some circumstances.

dark-penguin commented 11 months ago

The situation is: "present_with_time" works with any system except specific KDE setups which require "present". Based on this, I would suggest making "present_with_time" the default, as it "does more" and behaves correctly most of the time, and add an optional exception for KDE in case it does not work, rather than the default being "present" with an exception for MATE. But generally, I'm fine either way as long as I can configure it to behave properly on MATE.

Betterbird commented 11 months ago

Hmm, having a default that will make some people have to kill the program because they can't maximise any more is not a good idea.

Anyway, let's try to find out why those KDE user are seeing a problem with goes away on a fresh install.

dark-penguin commented 11 months ago

Oh, right - I forgot that the problem on MATE is that it merely does not activate properly when restoring.

Betterbird commented 11 months ago

https://www.betterbird.eu/downloads/get.php?os=linux&lang=en-US&version=latest now only uses the "with time" call on Mate. Generally configurable via pref mail.minimizeToTray.desktopsGtkWindowPresentWithTime. KDE users return back to the pre-115.3.1-bb14 state.