From a50db99d1590c05d4dd1a9f2b58a10e6ade55d7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Thu, 6 Aug 2015 22:44:09 +0200 Subject: [PATCH] Add QPlatformWindow::windowFrameGeometry() Convenience accessor for use by the Wayland platform plugin. Change-Id: I420209138cfc285f8396913548b9e158a35ee9c1 Reviewed-by: Paul Olav Tvete --- src/gui/kernel/qplatformwindow.cpp | 8 ++++++++ src/gui/kernel/qplatformwindow.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp index d10bd1e9ebe..0430d5a4c65 100644 --- a/src/gui/kernel/qplatformwindow.cpp +++ b/src/gui/kernel/qplatformwindow.cpp @@ -689,6 +689,14 @@ QRect QPlatformWindow::windowGeometry() const return QHighDpi::toNativePixels(window()->geometry(), window()); } +/*! + Returns the QWindow frame geometry. +*/ +QRect QPlatformWindow::windowFrameGeometry() const +{ + return QHighDpi::toNativePixels(window()->frameGeometry(), window()); +} + /*! Returns the closest acceptable geometry for a given geometry before a resize/move event for platforms that support it, for example to diff --git a/src/gui/kernel/qplatformwindow.h b/src/gui/kernel/qplatformwindow.h index 692ae862db5..1b283dbb4f3 100644 --- a/src/gui/kernel/qplatformwindow.h +++ b/src/gui/kernel/qplatformwindow.h @@ -138,6 +138,7 @@ public: QSize windowBaseSize() const; QSize windowSizeIncrement() const; QRect windowGeometry() const; + QRect windowFrameGeometry() const; QRectF windowClosestAcceptableGeometry(const QRectF &nativeRect) const; protected: