Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.5.0
-
None
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