Closed Bug 1708709 Opened 4 years ago Closed 3 years ago

[wayland] popup can be wrongly repositioned due to rounding errors when font scaling != 1

Categories

(Core :: Widget: Gtk, defect, P2)

defect

Tracking

()

RESOLVED FIXED
93 Branch
Tracking Status
firefox93 --- fixed

People

(Reporter: jhorak, Assigned: stransky)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

This could occasional lead to bug 1661516 and some other flickering/popup repositioning by one pixel horizontally or vertically.
It's because the rounding error which occurs between nsView/nsMenuPopupFrame and nsWindow.

Assignee: nobody → jhorak

We have to use wayland to position popup windows and we need to propagate the modified
position (if happens) back to nsView. The mScreenRect in the nsMenuPopupFrame is in the CSS units
and that produce rounding error when font scale factor is not 1. To fix that we will use appunits
for the mScreenRect.

Priority: -- → P3

Can you please test latest nightly under Wayland? A new popup handling code landed there.
Thanks.

Please re-test with new nightly as it gets another popup fixes.
Thanks.

Attachment #9220764 - Attachment description: Bug 1708709 Use appunits for mScreenRect to avoid rounding errors; r=stransky → Bug 1708709 Use appunits for mScreenRect to avoid rounding errors, r?emilio

The patch here works for me 'as-is'. Just updated to latest trunk and fired try:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=f43b791f113cbf2e818d71d6c3d1e384819e923a

Assignee: jhorak → stransky
Priority: P3 → P2

Yes, issue is fixed for context menus.

And partially fixed for extension popup windows (before, when i click on extension icon - it was transparent/blinking, and i cannot interact with it), now it does not blinks and renders fine, but i still cannot interact with it.

Affected extensions, for example:

Popup windows created by Pocket are not affected (works fine), but that's not really "extension" i guess.

Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/46c0a9a6b5e5 Use appunits for mScreenRect to avoid rounding errors, r=emilio
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch

Martin, do you think this is safe to uplift to beta? It seems to fix a major usability issue.

Flags: needinfo?(stransky)

This code it not Linux/Wayland specific and affects Windows/Mac too. Also recent Nightly will be Beta in ~week - so I think it's better to keep it in Nightly.

Flags: needinfo?(stransky)

Serhii, can you retest please?
Thanks.

Flags: needinfo?(serg.partizan)

Also If there's any popup bug remaining please open a new report for it.
Thanks.

Martin, everything is working fine.

  • Browser menus not blinking
  • Popup windows from extensions rendering correctly.

Thanks!

Flags: needinfo?(serg.partizan)

Oh, wait.

I was testing it without MOZ_ENABLE_WAYLAND=1 flag.

So, bug with inaccessible popup remains. I'll create separate issue then.

(In reply to Martin Stránský [:stransky] (ni? me) from comment #13)

This code it not Linux/Wayland specific and affects Windows/Mac too. Also recent Nightly will be Beta in ~week - so I think it's better to keep it in Nightly.

Martin: just wanted to let you know that at least on my setup this makes some weird popup flickering go away which makes daily usage much better. Would be super happy if you could consider adding it downstream in Fedora for the 92 build :)

Okay, will do.

Martin: I'm still having the menu flickering after updating to Firefox 93. Should I open a new bug report? I'm using Sway on Arch Linux with layout.css.devPixelsPerPx=1.2. Thanks for your time.

(In reply to Martin Stránský [:stransky] (ni? me) from comment #15)

Also If there's any popup bug remaining please open a new report for it.
Thanks.

Gosh, I didn't see this comment. I'll go ahead open a new report.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: