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

Clicking on a "new mail" notification (link or native "Activate") does not restore the window which was minimized to tray, but does focus the message. Causes confusion since message is marked as read. #200

Closed dark-penguin closed 1 year ago

dark-penguin commented 1 year ago

Sometimes clicking the "New message" popup would restore Betterbird and focus the message in question. And sometimes it does focus the message, but does not restore the window. So far, I couldn't find any pattern to this, but it's "not working" more often than it's "working".

It is supposed to restore every time, isn't it? I suppose there's some complexity around restoring the window?

Betterbird commented 1 year ago

Please clarify with some screenshots. Where do you click "New message"? And which (existing?) "message in question" are you talking about when you're about to write a new one?

dark-penguin commented 1 year ago

Screenshots are a bit tricky; I'll try to explain it "properly" first.

Expected behaviour:

Actual behaviour:

Please ask for screenshots again if this did not help. :)

dark-penguin commented 1 year ago

But I remember that at some point, the behaviour was "as expected" a few times - no idea why.

Betterbird commented 1 year ago

Hmm, on Linux there are two different notifications, the TB/BB notification and the system notification. I assume you're talking about the TB/BB notification which is displayed with clickable links rising from the system tray.

So the complaint is that clicking the link should also restore the window since otherwise you end up in a mess. I'll try what happens on Windows. (Would have been good it you had summarised the issue correctly in the title.)

dark-penguin commented 1 year ago

I believe what I am getting is a system notification. Because it's provided by ayatana, and configurable via mate-notification-properties. There is no link, just... I can get a screenshot of it, here: Screenshot at 2023-09-09 15-36-31

Betterbird commented 1 year ago

Whether you have system notifications can be set in the settings:

Native on Xfce: Screenshot from 2023-09-09 13-52-20

TB/BB style containing links: Screenshot from 2023-09-09 13-56-01

Anyway, both have the problem.

Betterbird commented 1 year ago

I'll try what happens on Windows.

OK, on Windows, the "hidden" (minimised to tray) window is restored when the notification is clicked. We'll check how that's done and port it to Linux.

Betterbird commented 1 year ago

Activation of the window was mostly not implemented, apologies for this oversight 😞. It's now implemented and will likely also change the activation behaviour on Gnome and KDE if the window wasn't minimised. @felixoi @Zahrun could you please give this a whirl: https://www.betterbird.eu/downloads/115-Preview/betterbird-115.2.0-bb10-refresh-resize-native-activate.en-US.linux-x86_64.tar.bz2

Of course it also fixes the ticket here, so when BB is minimised and your click onto a new mail notification, either system or BB style, the window is now restored (as well as always, pending the complaints in Issue #202).

felixoi commented 1 year ago

Sadly this is not working for GNOME. I only see a "Betterbird is ready" notification and the window is not getting in front.

Also I encountered an issue where mail.biff.show_tray_icon_always=true but that's only the case after it's minimized for the first time. The tray icon is not added on startup. Seems to be unrelated to this issue tho.

Betterbird commented 1 year ago

Tested this myself now: On KDE the window is brought to the foreground. On Gnome that also happens on the first double-click, the next one shows a panel "Betterbird is ready" or some such. Also tested clicking on new mail notification while the window was minimised and it's restored as it should.

Sadly this is not working for GNOME. I only see a "Betterbird is ready" notification and the window is not getting in front.

Hmm, for me it works once.

I don't understand the second issue. I was running with mail.biff.show_tray_icon_always=true and the icon is there when BB starts. Or am I misunderstanding?

dark-penguin commented 1 year ago

Clicking the popup now restores the window from tray (on MATE)! But usually either behind other windows, or if the last clicked "window" was the desktop, then in front but "unfocused".

The tray icon is not added on startup

This, however, I've never encountered yet.

Betterbird commented 1 year ago

Clicking the popup now restores the window from tray (on MATE)! But usually either behind other windows, or if the last clicked "window" was the desktop, then in front but "unfocused".

Issue #202.

The tray icon is not added on startup

This, however, I've never encountered yet.

@felixoi, this needs clarification: "that's only the case after it's minimized for the first time" doesn't seem to go well with "The tray icon is not added on startup".

felixoi commented 1 year ago

https://github.com/Betterbird/thunderbird-patches/assets/14966472/37f31a11-f0f9-4a4b-b21d-9043552e42b8

Here is a screencast. As you can see I'm starting betterbird in the command line and there is no tray icon even if mail.biff.show_tray_icon_always=true is enabled. The icon is added the first time im minimizing Betterbird and after that always shown as configured. I'd expect it's added at startup already, but this may be intended.

Betterbird commented 1 year ago

Thanks for the video. You only know what mix of software you're using there. There seems to be a "task bar" like on Windows, which we don't have, and the indicators all live on the bottom right. You mentioned a combination of the "AppIndicator and KStatusNotifierItem Support" extension with https://extensions.gnome.org/extension/1160/dash-to-panel/ (see https://github.com/Betterbird/thunderbird-patches/issues/111#issuecomment-1694713263). We're not using the latter.

We see this on start after setting the pref to true in a prior session:

image

We'll rest our case for a while. Some casual reading revealed that this not only depends on the desktop but also the window manager, so there are two moving parts which make it hard to win.

felixoi commented 1 year ago

I'm using the combination you mentioned. It's alright for me, not a huge bug. I just left it here because I observed it while testing the other things.