Closed Bug 1737715 Opened 4 years ago Closed 4 years ago

Firefox scales incorrectly when next to a hidpi screen on Wayland

Categories

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

Firefox 93
defect

Tracking

()

RESOLVED MOVED

People

(Reporter: akdor1154, Unassigned, NeedInfo)

References

(Blocks 1 open bug, )

Details

Attachments

(4 files)

Attached file firefox.excerpts.log

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4464.5 Safari/537.36

Steps to reproduce:

For context, I'm using Firefox in Wayland mode with Gnome Shell 40 as my compositor (stock Pop OS / Ubuntu 21.10).

I have three screens -
[ laptop internal ] [ Dell 1 , 1920x1200 ], [ Dell 2, 1280x1024]

laptop internal is High DPI, set to 200% scaling with fractional scaling disabled in wayland. Dell 1 and Dell 2 are 100% scaling. Dell 1 is my primary.

When Firefox is on the laptop internal display, it scales at 2× correctly.
When Firefox is on the Dell 2 display, it scales at 1× correctly.
When Firefox is on the right side of the Dell 1 display, it scales at 1× correctly.
These are all fine.
However, when Firefox is on the left side of the Dell 1 display, it scales roughly correctly (widgets are the right size visually), but text becomes a bit blurry and it gets a little bit slower when scrolling etc. I believe it's rendering at 2× and getting scaled down to 1× at some point.

I've attached a full log with Widget:5 debug, and also some excerpts annotated with me moving windows

  • start on internal (ok)
  • move to left of dell 1 (blurry problem here)
  • move to right of dell 1 (ok)
  • move back to left of dell 1 (blurry)
  • move to dell 2 (ok)

When I say "left of", "right of", I'm tiling my windows so that firefox takes up roughly half the screen. My tiler adds a margin of 2-4pixels or so, so Firefox is not at the very edge of the screen in these cases, it's inset a little bit (so likely this is more an off by >1 error than an off by 1 error ;) ).

This seems to support my theory that Firefox is getting rendered at 2× when on the left of Dell 1, and scaled down to 1× in some post step somewhere (firefox, gnome shell, who knows) that hides the problem.

Expected results:

Firefox should not be blurry when it's next to the HiDPI display.

Attached image ff on left, blurry.png
Attached image ff on right, good.png

Here is another way to show the problem - here, firefox is in windowed mode and I'm dragged it so the left edge is on either side of about X=10 or so on the left edge of Dell 1. If the left edge of FF is on the right of this line we get Scale=1, if it's on the left we get Scale=2.

This log shows output when I drag back and forth over this invisible line.

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

You may see https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3941 - gdk sends wrong scales.

Try latest nightly:
https://fedoraproject.org/wiki/How_to_debug_Firefox_problems?rd=Bug_info_Firefox#Testing_Mozilla_binaries
tun on terminal and unset XDG_CURRENT_DESKTOP env variable.

i.e. run something like:

XDG_CURRENT_DESKTOP="none" MOZ_ENABLE_WAYLAND=1 ./firefox

(but that introduces scaling issues on Gnome as it sends wrong screen sizes). So generally wait until https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3941 hits stable.

Flags: needinfo?(akdor1154)
Blocks: wayland
Priority: -- → P3

Nah in the meantime I realized it actually affects all GTK apps as well, I just noticed the text rendering in Firefox before I saw it in Gnome Terminal :)
Raised upstream at https://gitlab.gnome.org/GNOME/gtk/-/issues/4372 (well.. i tested with Gtk4 actually which I'm guessing Firefox isn't using, but the behaviour is identical)
Will check nightly in a bit just in case though.

Okay, moving then.

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → MOVED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: