lxqt-session icon indicating copy to clipboard operation
lxqt-session copied to clipboard

GKD_SCALE useless for fractional scaling

Open stefonarch opened this issue 1 year ago • 3 comments

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

Replace GDK_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
  • Distribution & Version: 1.4, 2.0, git, any

stefonarch avatar Sep 13 '24 11:09 stefonarch

What's GTK? Never heard of it ;)

tsujan avatar Sep 13 '24 13:09 tsujan

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 avatar Sep 15 '24 10:09 tsujan

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.

tsujan avatar Sep 15 '24 12:09 tsujan