Closed Bug 1659423 Opened 4 years ago Closed 4 years ago

[wayland] Mispositioned select popup in the new printing dialog

Categories

(Core :: Widget: Gtk, defect)

defect

Tracking

()

RESOLVED FIXED
82 Branch
Tracking Status
firefox82 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files)

The dropdown is in the top left of the screen. Haven't debugged this yet.

Emilio, can you post a screen please? Is that Wayland only? Is HiDPI involved?
Thanks.

Flags: needinfo?(emilio)

Yes, wayland only. HiDPI is involved (window.devicePixelRatio = 2), but the position is so off that it doesn't seem like a coordinate space confusion. See the top left of the screenshot.

STR should be just on this page for example do Ctrl+P (or File > Print Preview), then click on the "Save to PDF" dropdown.

Flags: needinfo?(emilio)

I see. This may be caused by missing link between parent/child window so the dropdown is created as toplevel. We can't position toplevel windows on Wayland.

I cannot reproduce this anymore somehow?

Gnome Wayland, Debian Testing, 2560x1440
Steps seem unchanged for me: Still reproducible with a maximized window.
$ MOZ_ENABLE_WAYLAND=1 mozregression --launch 2020-08-27 --pref gfx.webrender.force-disabled:true -a https://example.com

Oh, indeed! I hadn't noticed this was maximized-screen only... That's odd.

What is going on is that nsComboboxControlFrame first positions the 0x0
widget, then sizes it. But when moving a 0x0 wayland popup, we just bail
out in NativeMoveResizeWaylandPopup().

So unless we also change the offset in some other way, and hit this
code:

https://searchfox.org/mozilla-central/rev/dc30fc92f2d02abe716426df7eff0f0bbb907da2/view/nsView.cpp#335

when updating the view tree (which doesn't happen with the maximized
window, and actually it's a bit questionable that it happens without it,
there may be some pre-existing coordinate space confusion there) we'll
end up in a plain Resize() rather than MoveResize(), and never position
the widget at the right place.

This doesn't happen for regular web content because the new print dialog
lives in the parent process (which uses nsComboboxControlFrame) rather
than on the child (which uses nsMenuPopupFrame).

Assignee: nobody → emilio
Status: NEW → ASSIGNED

Finally got some time to dig into this.

Status: ASSIGNED → NEW
Status: NEW → ASSIGNED
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/de2ff8f555f0 Also move wayland popup if getting sane popup dimensions. r=stransky
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: