diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 6 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.h | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index c5d57be2ad..2c0ffc9b26 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -746,7 +746,8 @@ QWindowsWindowData const QWindowCreationContextPtr context(new QWindowCreationContext(w, data.geometry, rect, data.customMargins, style, exStyle)); QWindowsContext::instance()->setWindowCreationContext(context); - QMargins invMargins = topLevel && !(result.flags & Qt::FramelessWindowHint) && QWindowsGeometryHint::positionIncludesFrame(w) + const bool hasFrame = (style & (WS_DLGFRAME | WS_THICKFRAME)); + QMargins invMargins = topLevel && hasFrame && QWindowsGeometryHint::positionIncludesFrame(w) ? invisibleMargins(QPoint(context->frameX, context->frameY)) : QMargins(); qCDebug(lcQpaWindows).nospace() @@ -777,6 +778,7 @@ QWindowsWindowData result.geometry = context->obtainedGeometry; result.fullFrameMargins = context->margins; result.embedded = embedded; + result.hasFrame = hasFrame; result.customMargins = context->customMargins; return result; @@ -2232,7 +2234,7 @@ void QWindowsWindow::setFullFrameMargins(const QMargins &newMargins) QMargins QWindowsWindow::frameMargins() const { QMargins result = fullFrameMargins(); - if (isTopLevel() && !(m_data.flags & Qt::FramelessWindowHint)) + if (isTopLevel() && m_data.hasFrame) result -= invisibleMargins(geometry().topLeft()); return result; } diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index b9b398b67b..2675990cf1 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -112,6 +112,7 @@ struct QWindowsWindowData QMargins customMargins; // User-defined, additional frame for NCCALCSIZE HWND hwnd = 0; bool embedded = false; + bool hasFrame = false; static QWindowsWindowData create(const QWindow *w, const QWindowsWindowData ¶meters, |