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

Window is incorrectly moved to the top left corner of the screen when restoring from full screen on high dpi setups.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.15.0 Beta4
    • 5.14.2
    • QPA: Windows
    • None
    • Single screen with 200% scaling.
    • Windows
    • c92fedd761206231f13838528943619b84df55bf (qt/qtbase/5.15)

    Description

      I narrowed it down to this submit: "Windows QPA: Better recover from removed screens when fullscreen" 8afc6146be513e7adee6e4ade342e28951bfefc6 https://codereview.qt-project.org/c/qt/qtbase/+/187740

      It seems to have been incorrectly implemented where the high dpi conversion is made in the wrong place, one of which was fixed in "Windows QPA: Compare against correct geometry when checking for fullscreen" 216da37cc55c38a9901501ecb04f768ff4e78d8f https://codereview.qt-project.org/c/qt/qtbase/+/200302 . The QPlatformScreen returns native pixels while the QScreen returns scaled pixels.

      I would also like to question if the original change to move the window is even a good change? It feels like the wrong place and time to make sure the window is within the screen?

       

      Repro steps:

      1. Run the attached example.
      2. Move it to the lower/right part of a screen with scaling > 1
      3. Toggle fullscreen on with the toggle fullscreen button.
      4. Toggle fullscreen off and notice that the window is now in the upper right corner.
      Single screen with 200% scaling.
      
      qtdiag output (unsure why it says dpi scaling is inactive when it is in fact active):
      
      Screens: 1, High DPI scaling: inactive
      # 0 "\\.\DISPLAY1" Depth: 32 Primary: yes
        Manufacturer: 
        Model: 
        Serial number: 
        Geometry: 3000x2000+0+0 Available: 3000x1940+0+0
        Physical size: 285x190 mm  Refresh: 60 Hz Power state: 0
        Physical DPI: 267.368,267.368 Logical DPI: 192,192 Subpixel_None
        DevicePixelRatio: 1 Pixel density: 1
        Primary orientation: 2 Orientation: 2 Native orientation: 0 OrientationUpdateMask: 0
      

      Attachments

        1. qtbug83448.zip
          2 kB
        2. QTBUG-83448.cpp
          1 kB

        Issue Links

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

          Activity

            People

              kleint Friedemann Kleint
              cyriuz Viktor Arvidsson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes