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

Changing display scaling on Windows leads to cached device pixel ratio invalidation in QML window

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.7.2, 6.8.3
    • GUI: High-DPI
    • None
    • Windows 11, multi-monitor with mixed DPI scaling.
    • Windows
    • Windows

    Description

      • Steps to Reproduce:

        1. Setup:
          • Primary monitor: 4K display (3840x2160 @ 200% scaling).
          • Secondary monitor: 1080p display (1920x1080 @ 100% scaling).
          • Launch a Qt QML application in fullscreen/maximized mode on the 4K monitor.
        1. Trigger the issue:
          • On the secondary 1080p monitor, open Windows Display Settings.
          • Change the primary 4K monitor's resolution to 1920x1080 with 150% scaling.
        1. Observe:
          • In fullscreen/maximized mode:
            • The application logs:

              "The cached device pixel ratio value was stale on window expose. Please file a QTBUG which explains how to reproduce."

            • Rendered content (position/size) becomes incorrect.
          • In windowed mode:
            • The application repeatedly logs:
              QSGThreadedRenderLoop: expose event received for window QQuickWindowQmlImpl(0x24fea3795e0 exposed, visibility=QWindow::Windowed, flags=QFlags<Qt::WindowType>(Window), title=screentest, geometry=1069,191 636x479) with invalid geometry: QRect(1069,191 636x479) on QScreen(0x24fe6e5fcd0, name=\\.\DISPLAY1)
            • Window geometry validation fails despite correct coordinates.
        1. Restore original settings:
          • Revert the 4K monitor to 3840x2160 @ 200% scaling → rendering errors persist.

            Actual Result:

        • Cached device pixel ratio fails to update dynamically when display scaling changes.
        • In fullscreen/maximized mode: Rendering corruption (position/size mismatch).
        • In windowed mode: Repeated QSGThreadedRenderLoop warnings about invalid geometry.
        • Errors persist even after restoring original display settings.

          Expected Result:

        • Qt should automatically detect DPI/scaling changes and update rendering parameters.
        • Window geometry validation should handle coordinate updates correctly.
        • Window content should realign seamlessly after display configuration changes.

          Additional Notes:

        • Issue occurs in both fullscreen/maximized and windowed modes with distinct error patterns.
        • Workaround: Manually restarting the application temporarily resolves the issue.

      Attachments

        1. CMakeLists.zip
          2 kB
          Eric Zhou
        2. state1.png
          128 kB
          Eric Zhou
        3. state2.png
          70 kB
          Eric Zhou
        4. state3.png
          128 kB
          Eric Zhou
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sorvig Morten Sørvig
            realericzh Eric Zhou
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes