The reason this worked before is unclear. It could be suspected that we have made a dpi awareness change or Microsoft changed the behavior of the OpenThemeData function. Regardless, we expect the result to match the primary display which OpenThemeData doesn't do (anymore). Instead it returns a value based on the hwnd screen (which btw didn't always match the widget) and the cache system would then re-use that theme also for hwnds on other screens. The most obvious solution is to use OpenThemeDataForDpi to make sure we get a theme result matching the primary sceen. Then our correction of the result by with multiplying QWindowsStylePrivate::nativeMetricScaleFactor(widget) works again. This fix does not only fix QMenu sizes. It fixes the size for all widgets that use this theme function, which could return near random results before. We load this library dynamically since MinGW 11.2.0 won't link with it. [ChangeLog][QWidgets][QMenu] Fixed menu sizes on Windows systems with more screens. Fixes: QTBUG-112911 Pick-to: 6.5 Change-Id: I8fdfde2ef5b2aa407cbc74c85afe2c0b74026cff Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Yuhang Zhao <yuhangzhao@deepin.org> Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io> |
||
|---|---|---|
| .. | ||
| doc/snippets/code | ||
| generic | ||
| imageformats | ||
| networkinformation | ||
| platforminputcontexts | ||
| platforms | ||
| platformthemes | ||
| printsupport | ||
| sqldrivers | ||
| styles | ||
| tls | ||
| tracing | ||
| CMakeLists.txt | ||