Closed Bug 1734577 Opened 3 years ago Closed 3 years ago

New Mail Notification window has zero height

Categories

(Thunderbird :: General, defect)

Thunderbird 94
defect

Tracking

(thunderbird_esr91 unaffected, thunderbird94+ affected)

RESOLVED FIXED
95 Branch
Tracking Status
thunderbird_esr91 --- unaffected
thunderbird94 + affected

People

(Reporter: TbSync, Assigned: henry-x)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files)

I am on Windows 10. After update to Beta 94, the new mail notification window has a zero height.

Moz-regression identified https://phabricator.services.mozilla.com/D125376 as to be the cause.

After I observed this in Beta 94, I checked Daily 95 as well and it is reproducible there as well.

Attached image tempsnip.png

That's odd. Works for me on linux, I just tried it again.
Maybe it's timing dependent? Is there still a problem if you add say 500 or 1000 as timeout here: https://searchfox.org/comm-central/rev/bbe4fa02ba9884831453c336de90fb840a7185e6/mailnews/base/content/newmailalert.js#71?

I have set it to 1000 and it did not make a difference. I still get only the "line" not the window.

See Also: → 1735048

I can't reproduce it at will. BUT, I've seen it when the window is in the background (I saw a notification very very thin like a line tough).

John, if you can reproduce, can you try changing "DOMContentLoaded" to "load" at
https://searchfox.org/comm-central/rev/a47e2023ab1c1c824b48d247caed381bc4e4cd20/mailnews/base/content/newmailalert.js#20

Flags: needinfo?(john)

That sadly did not change anything.

Flags: needinfo?(john)

I think it may have something to do with this line https://searchfox.org/comm-central/rev/4ef79c7bd6bb26b3f9b000eb9438fad3ef2cbc0b/mailnews/base/content/newmailalert.js#112 which tries to hide the window by setting its height to 1.

The flow of the current code is:

  1. Wait until there is no drag event (see bug 948082) https://searchfox.org/comm-central/rev/4ef79c7bd6bb26b3f9b000eb9438fad3ef2cbc0b/mailnews/base/content/newmailalert.js#51-58 Note that I see a blank window in the top left corner whilst I am still dragging.
  2. Use sizeToContent on the window, and then set its innerHeight to 1 https://searchfox.org/comm-central/rev/4ef79c7bd6bb26b3f9b000eb9438fad3ef2cbc0b/mailnews/base/content/newmailalert.js#67
  3. Wait one event cycle and then set call sizeToContent on the window again, at this point the innerHeight is sometimes 3, hence the shrunk window. https://searchfox.org/comm-central/rev/4ef79c7bd6bb26b3f9b000eb9438fad3ef2cbc0b/mailnews/base/content/newmailalert.js#83

I'm not sure what the exact conditions are that create the 3 pixel height, but in my testing it seems that setting the innerHeight to 1 in the previous cycle is part of it. Note I am using Wayland for my window display.

We could probably scrap step 2, which I suspect is the cause. And we can improve step 1 by delaying the loading of the window for the drag event here https://searchfox.org/comm-central/rev/4ef79c7bd6bb26b3f9b000eb9438fad3ef2cbc0b/mailnews/base/src/MailNotificationManager.jsm#399 instead of after the window is already loaded.

I can make the patch for this bug, but I'm away until next wednesday, so feel free to take it off me before then if you want.

Assignee: nobody → henry
Status: NEW → ASSIGNED

I've often seen this on Windows 10, and was under the impression that it would increase in size after some seconds, but maybe that was an artifact from one of the other installations pushing their own notification.

FYI: Removing the call to resizeAlert(true) in line 67 (https://searchfox.org/comm-central/rev/4ef79c7bd6bb26b3f9b000eb9438fad3ef2cbc0b/mailnews/base/content/newmailalert.js#67) did fix the issue for me.

I can see that window.outerheight (which is set to 1) is never reverted to an actual height. All I can see it is moved, but both calls (resizeAlert(true) and resizeAlert(false)) move it to the same location. The parameter name indicates the window should be moved out of the screen, but that never seems to happen.

General tidy up of the notification code to avoid unnecessary window manipulation.

(In reply to John Bieling (:TbSync) from comment #9)

FYI: Removing the call to resizeAlert(true) in line 67 (https://searchfox.org/comm-central/rev/4ef79c7bd6bb26b3f9b000eb9438fad3ef2cbc0b/mailnews/base/content/newmailalert.js#67) did fix the issue for me.

I can see that window.outerheight (which is set to 1) is never reverted to an actual height. All I can see it is moved, but both calls (resizeAlert(true) and resizeAlert(false)) move it to the same location. The parameter name indicates the window should be moved out of the screen, but that never seems to happen.

Can you try my work-in-progress patch https://phabricator.services.mozilla.com/D129052 ? I'm having a separate issue on linux (I suspect from a recent change in mozilla-central), so I can't test if the window repositioning works.

Bug 1736877, which I think is linux specific, is what is causing me problems with testing.

See Also: → 1736877

Can you try my work-in-progress patch https://phabricator.services.mozilla.com/D129052 ?

The window is there (so the line issue is gone), but it is at the wrong position: Top left corner is where bottom right should be (so mostly out of my screen). Do you need a screenshot?

Position of window in Windows 10 with draft patch.

ok, thanks for the feedback, try with the updated patch

Attachment #9246894 - Attachment description: WIP: Bug 1734577 - Stop setting the notification window height to 1px. r=mkmelin → Bug 1734577 - Stop setting the notification window height to 1px. r=mkmelin
Attachment #9246894 - Attachment description: Bug 1734577 - Stop setting the notification window height to 1px. r=mkmelin → Bug 1734577 - Stop setting the notification window height to 1px. r=john.bieling
Target Milestone: --- → 95 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/3b47a57dfbcc
Stop setting the notification window height to 1px. r=john.bieling DONTBUILD

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: