Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Clarification on screen geometry and HiDPI



  • Hi all,

    I'm trying to understand QScreen::geometry in a Linux/X11/Plasma HiDPI desktop set up, and would appreciate some help in understanding those values.

    For example, I have two screens:

    • DP-1: 1920x1080, left
    • eDP-1: 3200x1800, right

    As X11 does not allow different scale factors for screens, I have a global scale factor of 2.

    The Plasma desktop environment also sets the following environment variables:

    • QT_SCREEN_SCALE_FACTORS=eDP-1=2;DP-1=2;DP-2=2;
    • QT_AUTO_SCREEN_SCALE_FACTOR=0

    Qt reports the screen geometry as follows (excerpt from qtdiag):

    Screens: 2, High DPI scaling: active
    # 0 "eDP-1" Depth: 24 Primary: yes
      Geometry: 1600x900+1920+0 (native: 3200x1800+1920+0) Available: 1600x900+1920+0
      Virtual geometry: 3520x900+0+0 Available: 3520x900+0+0
      2 virtual siblings
      High DPI scaling factor: 2 DevicePixelRatio: 2 Pixel density: 1
      Primary orientation: 2 Orientation: 2 Native orientation: 0 OrientationUpdateMask: 0
    
    # 1 "DP-1" Depth: 24 Primary: no
      Geometry: 960x540+0+0 (native: 1920x1080+0+0) Available: 960x540+0+0
      Virtual geometry: 3520x900+0+0 Available: 3520x900+0+0
      2 virtual siblings
      High DPI scaling factor: 2 DevicePixelRatio: 2 Pixel density: 1
      Primary orientation: 2 Orientation: 2 Native orientation: 0 OrientationUpdateMask: 0
    

    And there are multiple strange things that I fail to understand:

    1. The geometry of eDP-1 seems wrong - it has an x offset of 1920, but why isn't this number scaled accordingly? As far as I understand this geometry value should be a "logical" one, which means in a "logical" space the eDP-1 screen, being right of DP-1, should be positioned at +960+0.

    2. The available virtual geometry does not make sense at all - It seems the width of "3520" is just an addition of 1920 and 1600, which are a scaled value and an unscaled one.

    I'm using Qt 5.15.0. Any help is greatly appreciated.



  • This post is deleted!

Log in to reply