Primary password dialog has the wrong size on macOS
Categories
(Core :: Widget: Cocoa, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox-esr128 | --- | unaffected |
firefox132 | --- | unaffected |
firefox133 | + | verified |
firefox134 | + | verified |
People
(Reporter: simonf, Assigned: emilio)
References
(Regression)
Details
(Keywords: regression)
Attachments
(7 files, 1 obsolete file)
160.95 KB,
image/png
|
Details | |
2.56 MB,
image/png
|
Details | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
dmeehan
:
approval-mozilla-beta+
|
Details | Review |
52.32 KB,
image/png
|
Details |
My Nightly on MacOs is displaying the primary password dialog at what seems to be minimum window size. It cannot be resized. This has been happening for maybe a week.
Reporter | ||
Comment 1•4 months ago
|
||
Reporter | ||
Updated•4 months ago
|
Reporter | ||
Comment 2•4 months ago
•
|
||
Look like this is related to high-dpi issues. This is what happens when I drag the window to my other screen. The contents now fit in the window but they're too small.
Reporter | ||
Comment 3•4 months ago
|
||
:emilio, after about 172 tries the first plausible patch that mozregression has led me to is https://bugzilla.mozilla.org/show_bug.cgi?id=1924240 could you take a look, please?
Assignee | ||
Comment 4•4 months ago
|
||
[Tracking Requested - why for this release]: Reproducible regression, it seems, would be good to get to the bottom of it.
Sure, that sounds not-totally-unlikely. At a glance I can't repro on a single monitor, and I won't have access to multiple monitors until monday at best. Just to confirm, your setup is:
- macOS (inferred from screenshots)
- External monitor, with different DPI to native display (inferred from comment 2).
Right?
Also, which push did mozregression point to? I would kinda expect https://hg.mozilla.org/mozilla-central/rev/3613fc672c50, but maybe it's the later ones? (I landed that bug in separate pushes to ease bisection among other things).
Thanks!
Updated•4 months ago
|
Reporter | ||
Comment 5•4 months ago
|
||
:emilio, here you go: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=9f82cc33da0b3c376fdb2d5192bc4ff9b3167076&tochange=3613fc672c501bd6280abfe58e1f53e72f2cd5de
Assignee | ||
Comment 6•4 months ago
|
||
Assignee | ||
Comment 7•4 months ago
|
||
Can't test macOS until the evening, but if you can test comment 5 it'd be great.
Assignee | ||
Comment 9•4 months ago
|
||
Ok, I can reproduce the issue. Reduced STR:
- Go to about:preferences.
- Open DevTools (Cmd+Opt+I)
- Paste
Services.prompt.alert(window, "Some title", "some message")
This is only an issue if I'm on the low-res monitor, not the high-res (laptop).
Assignee | ||
Comment 10•4 months ago
|
||
So the issue here is that my patch made GetTopLevelWidget() return the
top level window across the widget chain, including this one in
particular:
We have two AppWindows parented:
- Top level browser -> Alert window.
It seems it's know that cocoa windows that aren't shown yet may have a
HiDPI scale factor different from their actual screen's scale factor:
This causes the alert window have a devicePixelRatio of 2 but the top
level have a devicePixelRatio of 1.
Which means that nsDeviceContext thinks we have a DPI of 1, but
AppWindow and co have a DPI of 2, causing this mismatch.
Fix this by making GetTopLevelWidget actually return the nsCocoaWindow
widget for the alert, not the other.
This restores the behavior for cocoa, but changes it for Windows and
Linux (Android can't have nested top level windows, afaict).
Given windows and Linux both had the concept of "top level widget" in a
similar fashion, I think we can try this. I'll add a smaller fix for
uplift purposes.
Assignee | ||
Comment 11•4 months ago
|
||
No intended behavior change. BackingScaleFactorChanged bails out if it didn't
in fact change. Make it check BackingScaleFactor() to account for the lazy
initialization.
Assignee | ||
Comment 12•4 months ago
|
||
It's not all that useful, and it's rather confusing.
Assignee | ||
Updated•4 months ago
|
Updated•4 months ago
|
Assignee | ||
Updated•4 months ago
|
Assignee | ||
Comment 13•4 months ago
|
||
This is an uplift friendly fix which just restores macOS behavior on
this problematic callsite, preventing issues like the one from comment
0.
What nsDeviceContext does with the widget is just calling GetDPI, and
nsChildView has a reasonable implementation, so this should be safe.
Updated•4 months ago
|
Updated•4 months ago
|
Updated•4 months ago
|
Assignee | ||
Comment 14•4 months ago
|
||
Comment on attachment 9435224 [details]
Bug 1926624 - [beta] Don't use GetTopLevelWidget on nsDocumentViewer::CreateDeviceContext on macOS. r=#mac-reviewers!
Beta/Release Uplift Approval Request
- User impact if declined/Reason for urgency: Minimal fix for regression (more proper fix is in still-to-be reviewed patches).
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: comment 0
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Minimal fix that restores behavior only on macOS.
- String changes made/needed: none
- Is Android affected?: No
Assignee | ||
Updated•4 months ago
|
Reporter | ||
Comment 15•4 months ago
|
||
I think this is affecting Thunderbird. Do we need a cross-lift?
Comment 16•4 months ago
|
||
Comment 17•4 months ago
|
||
Assignee | ||
Comment 18•4 months ago
|
||
Uplifting to beta would also fix it in tb afaiui
Comment 19•4 months ago
|
||
FYI FxA/Sync engineers have observed a similar effect to the "merge account" dialog as well. Noting that here if that helps with verifying/testing this case too.
Comment 20•4 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/252b49944c8e
https://hg.mozilla.org/mozilla-central/rev/a3018242e1b5
Comment 21•4 months ago
|
||
Comment on attachment 9435224 [details]
Bug 1926624 - [beta] Don't use GetTopLevelWidget on nsDocumentViewer::CreateDeviceContext on macOS. r=#mac-reviewers!
Approved for 133.0b7
Comment 22•4 months ago
|
||
uplift |
Updated•4 months ago
|
Updated•4 months ago
|
Comment 23•4 months ago
•
|
||
Reproduced the issue with Firefox 133.0b6 on macOS 12 with an external monitor with Primary password
and Merge Warning
dialogs and steps from comment 9. The dialogs are cropped.
The issue is verified fixed with Firefox 134.0a1 (2024-11-10) and 133.0b7 from comment 22 on Windows 10x64, macOS 12 and Ubuntu 24. The Primary password
, Merge Warning
and test dialogs from comment 9 are correctly displayed.
Description
•