Closed Bug 1661540 Opened 4 years ago Closed 3 years ago

[wayland] screen.height and screen.width return device pixels rather than CSS pixels.

Categories

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

defect

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox90 --- fixed

People

(Reporter: emilio, Assigned: stransky)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Open https://crisal.io/tmp/screen.html.

In wayland, on a maximized window (screen.width == window.innerWidth) I get (on a HiDPI screen):

innerWidth: 1920
innerHeight: 940
outerWidth: 1920
outerHeight: 1053
screen.width: 3840
screen.height: 2160

In X11 I get the expected:

innerWidth: 1920
innerHeight: 979
outerWidth: 1920
outerHeight: 1053
screen.width: 1920
screen.height: 1080

It seems something is not adjusting for DPI properly in the wayland code.

Assignee: nobody → stransky
Priority: -- → P1

gdk_screen_get_monitor_geometry() / gdk_screen_get_monitor_workarea() returns unscaled monitor/workarea sizes on X11
but scaled sizes on Wayland. So don't scale it on Wayland as it's already scaled.

Pushed by stransky@redhat.com:
https://hg.mozilla.org/integration/autoland/rev/9820e7f4db04
[Wayland] Don't scale reported monitor sizes on Wayland, r=jhorak
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
See Also: → 1708003
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: