Fractional DPI change not detected on Linux

NEW
Unassigned

Status

()

defect
P3
normal
19 days ago
19 days ago

People

(Reporter: bernat, Unassigned)

Tracking

(Blocks 1 bug)

67 Branch
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Reporter

Description

19 days ago

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

Steps to reproduce:

When changing DPI from 96 DPI to 144 DPI (1.5 scale factor), Firefox stays unaffected.

Actual results:

No change.

Expected results:

Firefox should scale to the new DPI setting. Currently, on Linux, Firefox is listening to "notify::scale-factor" event. However, scale factor is only an integer value. I think Firefox should also listen to "notify::gtk-xft-dpi" which is used to compute scale factor. This would be something like:

g_signal_connect_after(default_settings, "notify::gtk-xft-dpi",
                       G_CALLBACK(scale_changed_cb), this);

(but it would need another callback as it is not attached to the widget)

Component: Untriaged → Widget: Gtk
Product: Firefox → Core
Priority: -- → P3
Assignee: nobody → stransky
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Yes, I can reproduce it. When fractional scaling changes and firefox is restarted it works fine. Without the restart we have wrong display metrics. But it looks like Gtk3 bug to me as we use Gtk3 function to place the popups.

Assignee: stransky → nobody
Status: ASSIGNED → NEW

notify::gtk-xft-dpi is not related and it's not issued when scale changes. Also when the scale changes (from 100% to 200% and vice versa) the scale_change_cb is correctly called.

The fractional scaling renders by 100% or 200% scale to backbuffer and then applies the scale (1.5 for instance) on the backbuffer so the application can't get info about the 1.5 scale.

It's also Wayland related issue.

Blocks: wayland
See Also: → 1543035
Reporter

Comment 4

19 days ago

(In reply to Martin Stránský [:stransky] from comment #2)

notify::gtk-xft-dpi is not related and it's not issued when scale changes. Also when the scale changes (from 100% to 200% and vice versa) the scale_change_cb is correctly called.

The fractional scaling renders by 100% or 200% scale to backbuffer and then applies the scale (1.5 for instance) on the backbuffer so the application can't get info about the 1.5 scale.

I mentioned gtk-xft-dpi because just changing XSETTINGS' Xft/DPI value is enough for Firefox to pick the change (after a restart). GTK applications also handle correctly the change (without a restart), at least on X11, so I suppose they listen to this property as well. I am not using Gnome directly, I am using xsettingsd, modify its configuration file to change the value of Xft/DPI and send a HUP signal to trigger the change. Firefox is the only application not taking the change without a restart (but also the only one to support fractional scaling for non-text stuff, which is great!). GDK also has Gdk/UnscaledDPI which is mostly here to cancel Xft/DPI when using Gdk/WindowScalingFactor, but there seems to be no way to listen to it (or it's not documented). Maybe Gnome has another property to handle fractional scale, but I am not aware of it.

Reporter

Comment 5

19 days ago

It seems the situation is more complex. When invoking scale_changed_cb(), only the scaling factor is used, while on start, both the scaling factor and Xft/DPI are used. So, just invoking this callback doesn't help.

You need to log in before you can comment on or make changes to this bug.