diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 10 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 4717495009..ce2f30478d 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -986,6 +986,8 @@ QMargins QWindowsGeometryHint::frameOnPrimaryScreen(const QWindow *w, DWORD styl QMargins QWindowsGeometryHint::frameOnPrimaryScreen(const QWindow *w, HWND hwnd) { + if (!w->isTopLevel() || w->flags().testFlag(Qt::FramelessWindowHint)) + return {}; return frameOnPrimaryScreen(w, DWORD(GetWindowLongPtr(hwnd, GWL_STYLE)), DWORD(GetWindowLongPtr(hwnd, GWL_EXSTYLE))); } @@ -1022,6 +1024,14 @@ QMargins QWindowsGeometryHint::frame(const QWindow *w, HWND hwnd, DWORD style, D return frame(w, style, exStyle, dpi); } +QMargins QWindowsGeometryHint::frame(const QWindow *w, HWND hwnd) +{ + if (!w->isTopLevel() || w->flags().testFlag(Qt::FramelessWindowHint)) + return {}; + return frame(w, hwnd, DWORD(GetWindowLongPtrW(hwnd, GWL_STYLE)), + DWORD(GetWindowLongPtrW(hwnd, GWL_EXSTYLE))); +} + // For newly created windows. QMargins QWindowsGeometryHint::frame(const QWindow *w, const QRect &geometry, DWORD style, DWORD exStyle) diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index 915254dbd8..d18e617c7a 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -66,6 +66,7 @@ struct QWindowsGeometryHint static QMargins frameOnPrimaryScreen(const QWindow *w, HWND hwnd); static QMargins frame(const QWindow *w, DWORD style, DWORD exStyle, qreal dpi); static QMargins frame(const QWindow *w, HWND hwnd, DWORD style, DWORD exStyle); + static QMargins frame(const QWindow *w, HWND hwnd); static QMargins frame(const QWindow *w, const QRect &geometry, DWORD style, DWORD exStyle); static bool handleCalculateSize(const QMargins &customMargins, const MSG &msg, LRESULT *result); |