Closed Bug 1490297 Opened 6 years ago Closed 4 years ago

[wayland] when dual monitor setup (hi+normal dpi) the popups are wrongly placed

Categories

(Core :: Widget: Gtk, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox64 --- affected

People

(Reporter: jhorak, Assigned: jhorak, NeedInfo)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

The nsView::DoResetWidgetBounds use nsDeviceContext::GetDesktopToDeviceScale() [1] for getting the scale of the monitor by using [2] FindScreen method. The FindScreen does not work under Wayland because we cannot obtain window absolute position from the server.

Because the scale returned by GetDesktopToDeviceScale() returns always 1 or 2 (depends on which monitor is primary) it leads to wrong popup menu placement under wayland.

[1] https://searchfox.org/mozilla-central/rev/9e7995b3c384945740985107a4de601b27904718/view/nsView.cpp#363
[2] https://searchfox.org/mozilla-central/rev/9e7995b3c384945740985107a4de601b27904718/gfx/src/nsDeviceContext.cpp#725
In the Wayland we don't know the absolute position of the window, so we cannot
use it to determine on which monitor the window is. We need to use parent window
scale factor to scale popup windows, otherwise popup windows will be wrongly
placed in the hi+normal dpi monitor setup.
Comment on attachment 9008054 [details]
Bug 1490297 Use parent window scale factor for the popup windows under Wayland; r?bzbarsky

Matt Woodrow (:mattwoodrow) has approved the revision.
Attachment #9008054 - Flags: review+
Keywords: checkin-needed
Pushed by dluca@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c5b3caf36ddf
Use parent window scale factor for the popup windows under Wayland; r=mattwoodrow
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/c5b3caf36ddf
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Depends on: 1493081
Assignee: nobody → jhorak
I'm sorry, but this bug has made the latest Nightly completely unusable due to bug 1493081, and leaving it in its current state isn't acceptable.  I'll have to back this out and retrigger Nightlies.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Link to backout:
https://hg.mozilla.org/mozilla-central/rev/bb920e419166
Status: REOPENED → NEW
Target Milestone: mozilla64 → ---
Type: enhancement → defect

I can confirm. Can I somehow help with debugging, since it's last bug blocking [1] ?

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1543600

Flags: needinfo?(stransky)

(In reply to David Heidelberg from comment #8)

I can confirm. Can I somehow help with debugging, since it's last bug blocking [1] ?

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1543600

Unfortunately the tracker is missing some important bugs, I'll update it.

Flags: needinfo?(stransky)

Should be fixed now.

Status: NEW → RESOLVED
Closed: 6 years ago4 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.