Closing TB to tray and then clicking on a system notification (Delete/Mark as read) restores the program to the foreground
Categories
(Thunderbird :: OS Integration, defect)
Tracking
(thunderbird_esr153 unaffected)
| Tracking | Status | |
|---|---|---|
| thunderbird_esr153 | --- | unaffected |
People
(Reporter: helge.huettenlechner, Assigned: lachcim)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 external file)
Closing TB to tray and then clicking on a system notification (Delete/Mark as read) restores the program to the foreground.
This undesired. Just minimising doesn't restore when a notification is clicked.
This is a regression wrt. to TB 153. When minimising to the tray in 153, clicking onto a notification also didn't restore.
Mozregression found this:
https://hg-edge.mozilla.org/comm-central/pushloghtml?fromchange=5b9b08fcb8b33a4b6027d1dc17e0b9edd360e1c0&tochange=9ed2cdca76f6a8792976b7092e743a75bcd64719
Somehow the second patch in bug 2044250 interferes with the system notification.
| Assignee | ||
Comment 2•15 days ago
|
||
I can confirm that the bug does occur but it's unrelated to the change to HandleIconLeftClick (or HandleIconActivate as it's currently called). Removing the IsIconic check does not resolve the issue. As a matter of fact, HandleIconActivate is not being called here at all.
There has recently been a change to the notification system that merged around the same time as my changes did: https://phabricator.services.mozilla.com/D308321. This may or may not be relevant here. I'll try to investigate.
I've just pasted the regression range that mozregression gave me.
You can re-run it with an interval of a week to see whether you can reproduce it. The test is very simple: Use an IMAP account. When mozregression opens a version to test, send yourself an e-mail and immediately close the main window to the tray. When the notification arrives, click "Delete". You get the outcome in one session of the version offered by mozregression.
The equivalent m-c range is this:
https://hg-edge.mozilla.org/mozilla-central/pushloghtml?fromchange=753949d46919a43c1c0105e49607eaa33c047a9e&tochange=e3ade567c5856015183569f9161a9381c43b3834
I looked for "toast" and "notif", but didn't see a related bug.
The bug you're referring to, bug 2049782, landed in July 2026, about two weeks after the regression, if the range is correct.
| Assignee | ||
Comment 4•14 days ago
|
||
When Thunderbird is hidden and moved to the tray, the user may still receive notifications about incoming emails. Clicking the notification should restore Thunderbird. Clicking an action button like "Mark as read" should not.
ToastNotificationHandler.cpp in mozilla-central unconditionally calls SetForegroundWindow on the most recent browser window when a notification is clicked. Apparently, minimizing the window before hiding it prevents SetForegroundWindow from un-hiding it. This is what we used to do prior to D308142. Here, we do it inside HideWindow to make sure the behavior stays consistent.
Testing:
1. Enable "When Thunderbird is closed, move it to the tray"
2. Enable "Show an alert for new emails" and "Use the system notification"
3. (Optional) Start devtools
4. Close Thunderbird to the tray
5. Get an incoming email notification. Here's a shortcut: MailNotificationManager._showAlert({ folder: { generateMessageURI: () => "", markMessagesRead: () => {} } }, "hello", "world", 1)
6. Click the notification itself, not one of the action buttons
7. Thunderbird should reappear
8. Close Thunderbird to the tray
9. Get an incoming email notification
10. Click one of the action buttons, e.g. "Mark as Read"
11. Thunderbird should not reappear
Updated•14 days ago
|
| Assignee | ||
Comment 5•14 days ago
|
||
My bad, it didn't occur to me that this behavior could really be affected by minimizing the window. Thanks for double checking!
Updated•13 days ago
|
| Assignee | ||
Comment 6•11 days ago
|
||
Check-in needed. It asked for a target milestone, I hope I got that right.
Pushed by jtracey@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/739beb08ba75
Don't restore hidden windows when a notification action is clicked. r=aleca
Description
•