Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-114536

[REG 5.6.3->5.15.3] Linux: QT_ENABLE_HIGHDPI_SCALING env var no longer has any effect

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 5.15.3, 5.15.8
    • GUI: High-DPI
    • None
    • Rocky Linux 8.6, xrandr 1.5.0, Xorg 1.20.11
    • Linux/Other display system

    Description

      My team and I have been attempting to resolve our GUI high DPI issues with the recommendations you provided here. Part of our project involved migrating over to Qt 5.15.
      Before doing so, we tested out setting QT_AUTO_SCREEN_SCALE_FACTOR on Qt 5.6.3, which scaled GUIs well on both Windows and Linux, except for scaling their dialog sizes.
      Then we moved over to Qt 5.15.3 with QT_ENABLE_HIGHDPI_SCALING to replace QT_AUTO_SCREEN_SCALE_FACTOR and found that it improved on Windows with the inclusion of scaling the dialog sizes. However, it has no effect on Linux. Thus, it seems that this is a regression from 5.6.3. It is still an issue in 5.15.8. This problem is reproduceable by setting export QT_ENABLE_HIGHDPI_SCALING prior to launching a QApplication GUI.
      To work around this, we set QT_SCREEN_SCALE_FACTORS based on the user's monitor setup (1 for 2K monitors and 1.5 for 4K}}). This worked well with scaling fonts, images, and icons, as well as the appropriate placement of QSystemTrayIcon context menus. However, unlike on Windows, the dialog sizes don't autoscale.
      We attempted to patch our build of 5.15.8 so that we could get it to behave like it did with QT_AUTO_SCREEN_SCALE_FACTOR in 5.6.3, but were unsuccessful. This was still the case when we applied your future patch for xrandr.
      [EXPECTED] It would be nice if we could get the Linux side of Qt 5.15.8 to behave like the Windows side when QT_ENABLE_HIGHDPI_SCALING is set with the following behaviour:
      High-res scaling of fonts
      High-res scaling of icons and images
      Appropriate placement of QSystemTrayIcon context menus
      Scaling of dialog/window sizes
      You can see attached tables showing screen sizes and DPIs on 2K and 4K monitors before and after QT_ENABLE_HIGHDPI_SCALING is set on Windows and Linux with Qt 5.15.3.

      NOTE: There is also no effect when using Qt::AA_EnableHighDpiScaling attribute.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sorvig Morten Sørvig
            lbhagwandat Lauren Bhagwandat
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes