Go to file
Tor Arne Vestbø fa0b2ef81c Windows: Decouple screen change monitoring from top level QWindows
The WM_DISPLAYCHANGE message it sent when displays are added, removed,
or update their properties such as the scale/DPI.

We were processing this message as part of QWindowsContext::windowsProc(),
which meant that we would only react to display changes if there was a
QWindow on screen. Just creating a QGuiApplication was insufficient to
pick up changes to screens after startup.

In addition, despite being documented to post messages to child windows,
WM_DISPLAYCHANGE only ends up in top level windows. Presumably it's the
top level window's responsibility to post the message to child windows.
As a result, if a QWindow was a native child window of a foreign window,
such as in audio plugins being hosted in a DAW, we would again fail to
pick up display changes.

We solve both these cases by decoupling the WM_DISPLAYCHANGE handling
from QWindowsContext::windowsProc(), by creating a dedicated window
for listening to WM_DISPLAYCHANGE. This is similar to how we already
handle tray icons, power notifications, clipboard, etc -- the only
difference being that since purely HWND_MESSAGE windows do not
receive WM_DISPLAYCHANGE it's an actual invisible WS_TILED window.

This also lets us remove the workaround for QTBUG-79248, which was
doing screen updates in response to WM_DPICHANGED when detecting
that there were no QWindows.

Task-number: QTBUG-103383
Task-number: QTBUG-79248
Fixes: QTBUG-102343
Pick-to: 6.4
Change-Id: I905d8253069ec339b193edf05c052d21361ca3e9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-06-18 21:08:02 +02:00
.github/workflows Repair github action workflow 2021-11-10 18:57:33 +01:00
bin CMake: Automatically use Xcode generator in qt-cmake + iOS 2022-05-20 13:06:00 +02:00
cmake Add missing argument to list(APPEND in __qt_internal_get_tool_imported_location 2022-06-17 18:02:24 +02:00
coin Try to consolidate Unix/Windows libexec directory in coin configs 2022-06-15 23:58:16 +02:00
config.tests CMake: Test the linker too for -mno-direct-extern-access 2022-05-25 16:29:31 -07:00
dist Add Qt 6.0.0 changes file 2020-11-16 10:02:08 +02:00
doc Fix typos in docs and comments 2022-06-15 21:31:02 +02:00
examples Fix typos in docs and comments 2022-06-15 21:31:02 +02:00
lib Purge all fonts 2015-08-18 19:59:14 +00:00
libexec Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
LICENSES Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
mkspecs wasm: don't enable specialHTMLTargets by default 2022-06-01 13:52:47 +02:00
qmake Teach qmake about digit-grouping apostrophes in numeric literals 2022-06-17 00:05:53 +02:00
src Windows: Decouple screen change monitoring from top level QWindows 2022-06-18 21:08:02 +02:00
tests Update window state in QWindowsWindow and QXcbWindow geometry setters 2022-06-17 18:59:22 +00:00
util sanitizer-testrunner: enforce line buffering 2022-06-16 21:04:48 +02:00
.cmake.conf Bump version to 6.5.0 2022-06-06 13:23:59 +03:00
.gitattributes Give batch files CRLF line endings 2020-11-04 15:02:29 +00:00
.gitignore Assume qhelpgenerator in libexec instead of bin 2021-11-08 19:27:32 +01:00
.lgtm.yml Skip LGTM analysis for the bootstrap library and tools 2020-07-16 01:04:34 +02:00
.tag Update the git-archive export options 2012-09-07 15:39:31 +02:00
CMakeLists.txt Use REALPATH based check for symbolic links on Windows 2022-01-07 14:31:38 +01:00
conanfile.py Conan: Don't add 'qt_host_path' automatically when cross-building 2022-06-02 08:33:21 +03:00
config_help.txt C++23/c++2b support 2022-06-08 19:43:34 +02:00
configure Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
configure.bat Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
configure.cmake CMake: Fix typos 2022-06-13 15:37:36 +02:00
dependencies.yaml Re-add dependencies.yaml now that qt5.git wip/qt6 builds fine 2019-09-18 13:19:31 +02:00
qt_cmdline.cmake C++23/c++2b support 2022-06-08 19:43:34 +02:00
sync.profile Remove deprecated qgl.h from sync.profile 2022-06-11 00:42:13 +02:00