diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2012-06-27 17:15:42 +0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-28 10:18:15 +0200 |
commit | bbb15b4612946851d7d81940a9cd6e3a3753c3f2 (patch) | |
tree | c6448a269139ac5632982cde8455bd2de9c70cb4 /src/plugins | |
parent | 4dd2de9c7676220d2ac47f679ae05719078da0d0 (diff) |
Further fixes to widget masking
If mask was set to a widget before the widget was shown,
the mask was not applied.
Also, if toplevel widgets were set a mask in Windows, the mask was
applied to frame coordinates instead of client coordinates.
Ported relevant code from Qt4 to fix these issues.
Change-Id: Id6187cf4952b81b5b60c167e2fd284b7dc83ed9c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index a7140a3d6d..2b86113387 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1392,6 +1392,13 @@ void QWindowsWindow::setMask(const QRegion ®ion) return; } const HRGN winRegion = qRegionToWinRegion(region); + + // Mask is in client area coordinates, so offset it in case we have a frame + if (window()->isTopLevel()) { + const QMargins margins = frameMargins(); + OffsetRgn(winRegion, margins.left(), margins.top()); + } + // SetWindowRgn takes ownership. if (!SetWindowRgn(m_data.hwnd, winRegion, true)) DeleteObject(winRegion); |