Closed Bug 1824552 Opened 2 years ago Closed 1 years ago

[wayland] Use ScreenGetterGtk on Gnome with fractional scaling

Categories

(Core :: Graphics, task)

task

Tracking

()

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: rmader, Assigned: emilio)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files)

On Wayland there are two common ways to implement scaling:

  1. Integer-only scaling, compatible with Xwayland HiDPI clients. This is used on Gnome by default
  2. Fractional scaling. This is used by default by all other common Wayland compositors, as well as on Gnome if fractional scaling is enabled (scale-monitor-framebuffer experimental setting).

For 1. there's a special ScreenGetterWayland implementation that is used instead of ScreenHelperGTK on Gnome. Lets try to detect when Mutter is running with fractional scaling enabled and use ScreenHelperGTK in that case.

P.S.: this, among other things, fixes wrongly sized popups on Gnome with fractional scaling.

I think we should just do this unconditionally, see bug 1753601 (and bug 1753601 comment 48 in particular)...

See Also: → 1753601

Oh, are you sure ScreenGetterGTK works correctly for Gnome without fractional scaling? If so - awesome!

This fixes screen sizes when using mutter with fractional scaling, and
shouldn't change behavior otherwise.

Without this patch, mutter with scale at 150% reports:

[screen.width, screen.height] == [ 1920, 1080 ]

With this it reports the proper [ 2560, 1440 ].

The bug that caused us to introduce it was long fixed in gtk itself, as
I understand it, and ScreenGetterGtk is also what's used everywhere else
on Wayland.

Re-implement GetScreenForWindow in a way that works for ScreenGetterGtk
too, to avoid regressing any functionality on mutter.

Depends on D186341

Assignee: robert.mader → emilio
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3b3db7c9f72b Move ScreenHelper implementation details to the cpp file. r=stransky https://hg.mozilla.org/integration/autoland/rev/3b5a0c666d81 Remove ScreenGetterWayland. r=stransky
Status: ASSIGNED → RESOLVED
Closed: 1 years ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
Regressions: 1851225
Regressions: 1869724
Regressions: 1881090
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: