Closed Bug 1726964 Opened 3 years ago Closed 2 years ago

UI fonts ignore pixelsPerPx after restart

Categories

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

Firefox 91
Desktop
Linux
defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox91 --- affected
firefox92 --- affected
firefox93 --- affected

People

(Reporter: joyr4rzt, Unassigned)

References

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0

Steps to reproduce:

Create a new profile
Go to about:config and edit layout.css.devPixelsPerPx to 0.5 so the UI is tiny
Take a screenshot
Close Firefox
Open Firefox
UI fonts, eg tab titles, bookmark toolbar, menus, are all bigger than they were in the screenshot.

Tested on Kubuntu Linux Firefox 91 on a hidpi screen (pixelsPerPx=-1.0 is the same as 2.0)
Also affects Nightly on the same system: v93.0a1 (2021-08-21)
Also affects Nightly on an Ubuntu VM without hidpi screen.

Actual results:

Fonts are too big compared to the rest of the UI. Other UI elements, such as icons, appear to be honoring pixelsPerPx.

Expected results:

Fonts should stay the same size when closing and opening Firefox, and be consistent with the rest of the UI.

Summary: UI fonts ignore pixelsPerPx → UI fonts ignore pixelsPerPx after restart

Tested on a Windows 10 VM and it works as expected. So this looks like a Linux-specifc bug. Forgot to add Kubuntu and Ubuntu tests were both on LTS 20.04 releases.

I was able to replicate this using Ubuntu 20 64 bit and firefox release 91.0.1 , beta 92.0b7 and nightly 93.0a1

For macOS after restart the size is fine, but there is a different issue tho, since the close and minimize buttons started to show up incorrectly and cut. For Windows10 the issue is not visible

Severity: -- → S4
Status: UNCONFIRMED → NEW
Component: Untriaged → Layout
Ever confirmed: true
OS: Unspecified → Linux
Product: Firefox → Core
Hardware: Unspecified → Desktop

This is bug 1554409 and bug 1336558, which were closed as WONTFIX per the reason described in bug 1336558 comment 7... The condition responsible for this is this one.

I guess the inconsistency is probably because devPixelsPerPx doesn't invalidate the nsXPLookAndFeel cache, so that code doesn't get run again after changing the pref.

Karl, given all other platforms don't behave like this perhaps we should reconsider our decision here? devPixelsPerPx is a common way to change the scale of all the UI (including the browser UI), so it's a bit weird that only system fonts undo that scaling.

If you still think the current behavior could still be useful for some users, perhaps we could add a default-off pref for the current behavior?

Component: Layout → Widget: Gtk
Flags: needinfo?(karlt)
See Also: → 1336558, 1554409

(In reply to Emilio Cobos Álvarez (:emilio) from comment #3)

I guess the inconsistency is probably because devPixelsPerPx doesn't invalidate the nsXPLookAndFeel cache, so that code doesn't get run again after changing the pref.

Seems likely. Before GetFont() started to return sizes in CSS pixels, the device pixel system values would not have depended on the size of a CSS pixel.

Karl, given all other platforms don't behave like this perhaps we should reconsider our decision here?

I'm not aware of any new information that would change an assessment here.

devPixelsPerPx is a common way to change the scale of all the UI (including the browser UI), so it's a bit weird that only system fonts undo that scaling.

I understand that some might like to use a mechanism to experiment with scaling the whole UI, but that is not the purpose of devPixelsPerPx, which is a common way to change the size of a CSS pixel.

Having different sized UI fonts to other applications is not something that many users would want. There already exist mechanisms for scaling system sizes, which also affect default sizes for CSS pixels.

The UI has chosen to use system font sizes (for some fonts at least) rather than font sizes in CSS pixels. That choice seems reasonable to me.

If you still think the current behavior could still be useful for some users, perhaps we could add a default-off pref for the current behavior?

devPixelsPerPx is the right pref for scaling CSS pixels.

FWIW, there is now a similar "Default zoom" in about:preferences, which in some ways works best with devPixelsPerPx set to 1.0, given zoom levels when image viewing and default value of "toolkit.zoomManager.zoomValues".

Flags: needinfo?(karlt)
See Also: → 1439857, 1526294

(In reply to Karl Tomlinson (:karlt) from comment #4)
If pixelsPerPx is not supposed to change the UI fonts there are two bugs:

  • Bug 1: editing pixelsPerPx immediately changes the UI's font size. There should be no such change. This affects Firefox on Windows, Mac and Linux.
  • Bug 2: On Windows and Mac the effects of Bug 1 persist after a restart.

So all platforms are wrong to change the font size and Linux is the only platform to correct itself after a restart.

See Also: → 852963

The severity field for this bug is relatively low, S4. However, the bug has 5 See Also bugs.
:stransky, could you consider increasing the bug severity?

For more information, please visit auto_nag documentation.

Flags: needinfo?(stransky)
Flags: needinfo?(stransky)
See Also: → 1777902

The meaning of layout.css.devPixelsPerPx has changed with changes for bug 1773342.
AFAIK restarts are no longer necessary with this new behavior and corrections for bug 1773823.

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