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

layout managers scale windows for hi-dpi monitor when the system has both attached

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.6
    • None
    • Arch Linux, X11, on 13" retina MacBook Pro with external 27" 1920x1080 monitor attached

    Description

      Using the highdpi manual test or the qscreen manual test, and many others:

      QT_SCREEN_SCALE_FACTORS="eDP1=2;HDMI2=1" ./highdpi

      See attached screenshots.

      It depends which monitor is set to the primary. Let's start with the external low-resolution monitor being primary: If the window is shown on the high-dpi screen, the layout is reasonable; if it's shown on the low-res screen, it's stretched out.

      The other way, with the laptop's high-dpi monitor being primary: if the window is on the low-res screen, it's both stretched out and the fonts are half as big; but if the fonts were not wrong, the scaling would actually be reasonable. Moving the window to the high-res screen, it looks OK.

      Maybe we should use the device pixel ratio of the screen on which the window is going to be shown? But I realize that decision is up to the window manager, so we don't know it very early. (If my terminal window where I'm starting it from is on one screen, and the mouse is on that screen, it's more likely to be mapped to that screen.) Asking the widget's layout manager for its preferred size would need to be postponed until the window has been mapped. That sounds like it would lead to jumping to a different size; but in fact the jumping already happens sometimes too - sometimes I see the window flash on the screen at one size which was probably OK, and then shrink or grow to a sub-optimal size. But that may just be the QScreen manual test because it calls setGeometry.

      Attachments

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

        Activity

          People

            tvete Paul Olav Tvete
            srutledg Shawn Rutledge
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes