From 7c5c857679a0f58ca8fe5dcc9f8de3e3d83f0290 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 30 Apr 2019 09:21:44 +0200 Subject: Windows QPA: Fix over-large transparent tooltips Setting transparency (WS_EX_LAYERED) causes a WM_PAINT to be sent to the invisible windows, which causes a resize to the default size (640x480) to be sent from QGuiApplicationPrivate::processExposeEvent(). Suppress these messages. Fixes: QTBUG-75455 Change-Id: Idc540aa7f9bf0047e78ec7c27db260940483f7c4 Reviewed-by: Andre de la Rocha --- src/plugins/platforms/windows/qwindowswindow.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp') diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 0376e363f3..dc9aa0da23 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1875,6 +1875,9 @@ bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message, { if (message == WM_ERASEBKGND) // Backing store - ignored. return true; + // QTBUG-75455: Suppress WM_PAINT sent to invisible windows when setting WS_EX_LAYERED + if (!window()->isVisible() && (GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_LAYERED) != 0) + return false; // Ignore invalid update bounding rectangles RECT updateRect; if (!GetUpdateRect(m_data.hwnd, &updateRect, FALSE)) -- cgit v1.2.3