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

[Windows 11] Qt::Tool windows do not receive DPI events

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.5.0
    • GUI: High-DPI
    • None
    • Windows

    Description

      Windows 11: Version 10.0.22621 Build 22621

       

      Unfortunately this is a Microsoft bug by the looks of things, but it will effect any users of QWidgets with the Qt::Tool flag set on Windows 11. (Or at least the version mentioned above)

       

      The ask here is to provide a possible workaround in the interim.

       

      Partially related to: https://bugreports.qt.io/browse/QTBUG-123086

      WM_DPICHANGED events trigger a resize which seem to drive the QWidgets DPI handling code.

      If that resize never happens (either due to the fixed widget issue above, or no actual WM_DPICHANGED event) the qwidgetwindow doesn't handle the new DPI immediately.

       

      qwidgetwindow does seem to handle a screen changed event (when moving the window between screens), but it does not handle the signal:

      QScreen::physicalDotsPerInchChanged

      Which will get triggered by a WM_DISPLAYCHANGE event, that would help cover any edge cases like the fixed window size issue and the windows bug with Qt::Tool.

      (For example QQuickWindow handles the "physicalDotsPerInchChanged" signal today and things seem to work better)

       

      Edit: ToolWidgetDPI_Issue.zip is the QWidget sample, WS_EX_TOOLWINDOW_DPI_BUG.zip is the Win32 example

      Attachments

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

        Activity

          People

            sorvig Morten Sørvig
            ctummon Cathal Tummon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes