lxqt / lxqt-session

The LXQt session manager
https://lxqt.github.io
GNU Lesser General Public License v2.1
57 stars 49 forks source link

GKD_SCALE useless for fractional scaling #541

Open stefonarch opened 2 months ago

stefonarch commented 2 months ago

Playing with fractional scaling I noticed that firefox and GTK3 apps in general don't scale if not set to 2 or 3. A value in lxqt-config-session of 1.22 will be produce env vars like

GDK_SCALE=1.15
QT_SCALE_FACTOR=1.15

where the first just does nothing, resulting in GTK applications not upscaled.

Expected Behavior

Global Scale Factor should be global

Current Behavior

If not set to an integer GTK apps are not affected at all.

Possible Solution

ReplaceGDK_SCALE= with GDK_DPI_SCALE

Steps to Reproduce (for bugs)
  1. Set global scale factor to 1.2
  2. Relogin and open any GTK app
  3. In Session Settings→ Advanced change GDK_SCALE=1.2 to GDK_DPI_SCALE=1.2
  4. Restart session and check GTK apps.

                              -
System Information
tsujan commented 2 months ago

What's GTK? Never heard of it ;)

tsujan commented 2 months ago

GDK_DPI_SCALE (fractional) is only for fonts, while GDK_SCALE (integer) is for everything. The first can be set to 0.5 with a value of 2 for the second. Apparently, GDK_SCALE works only on X11. All in all, it's a mess. See https://docs.gtk.org/gtk3/x11.html

We already know that QT_SCALE_FACTOR doesn't work very well under Wayland either. So, the "Global Screen Scaling" is mainly for X11, with the above-mentioned limitation of GTK (= only the integer part is applied).

tsujan commented 2 months ago

More on this:

Qt successfully dealt with something that GTK avoided (https://gitlab.gnome.org/GNOME/gtk/-/issues/4345), namely, fractional scaling. It isn't (and can't be) ideal, but it works well for most.

As Qt users, we know that scaling is for everything in the GUI: fonts, icons, radii of rounded corners, thicknesses of lines,… Even QT_FONT_DPI has the same effect, although it's supposed to be only about fonts (try QT_FONT_DPI=200 APP).

Since what GNOME does has never been normal after its version 3, I think we don't need to torture ourselves because of GTK and its settings.