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 <andre.rocha@qt.io>
This commit is contained in:
Friedemann Kleint 2019-04-30 09:21:44 +02:00
parent 83347e2d39
commit 7c5c857679

View File

@ -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))