From 29fa85eed1d7c63299b4b3001ec18d0e6d2730d7 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Wed, 4 Mar 2020 14:12:23 +0200 Subject: [PATCH] Use SurfaceInterface::boundingRect() Reviewers: #kwin, davidedmundson Reviewed By: #kwin, davidedmundson Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D27831 --- xdgshellclient.cpp | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/xdgshellclient.cpp b/xdgshellclient.cpp index 3bfc918f08..d38705b87b 100644 --- a/xdgshellclient.cpp +++ b/xdgshellclient.cpp @@ -47,7 +47,6 @@ along with this program. If not, see . #include #include #include -#include #include #include @@ -320,28 +319,9 @@ QPoint XdgShellClient::clientContentPos() const return -1 * clientPos(); } -static QRect subSurfaceTreeRect(const SurfaceInterface *surface, const QPoint &position = QPoint()) -{ - QRect rect(position, surface->size()); - - const QList> subSurfaces = surface->childSubSurfaces(); - for (const QPointer &subSurface : subSurfaces) { - if (Q_UNLIKELY(!subSurface)) { - continue; - } - const SurfaceInterface *child = subSurface->surface(); - if (Q_UNLIKELY(!child)) { - continue; - } - rect |= subSurfaceTreeRect(child, position + subSurface->position()); - } - - return rect; -} - QSize XdgShellClient::clientSize() const { - const QRect boundingRect = subSurfaceTreeRect(surface()); + const QRect boundingRect = surface()->boundingRect(); return m_windowGeometry.size().boundedTo(boundingRect.size()); } @@ -1321,7 +1301,7 @@ void XdgShellClient::handleCommitted() } if (!m_hasWindowGeometry) { - m_windowGeometry = subSurfaceTreeRect(surface()); + m_windowGeometry = surface()->boundingRect(); } updatePendingGeometry();