diff --git a/src/window.cpp b/src/window.cpp index d81ffc9b7c..7c4310ec33 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -4225,15 +4225,6 @@ void Window::checkOffscreenPosition(QRectF *geom, const QRectF &screenArea) } } -/** - * Returns the natural size of the window, if the window is not shaded it's the same - * as size(). - */ -QSizeF Window::implicitSize() const -{ - return clientSizeToFrameSize(clientSize()); -} - /** * Constrains the client size @p size according to a set of the window's size hints. * diff --git a/src/window.h b/src/window.h index 16b3cadb20..d8386d416a 100644 --- a/src/window.h +++ b/src/window.h @@ -1147,7 +1147,6 @@ public: virtual QSizeF constrainClientSize(const QSizeF &size, SizeMode mode = SizeModeAny) const; QSizeF constrainFrameSize(const QSizeF &size, SizeMode mode = SizeModeAny) const; - QSizeF implicitSize() const; /** * Calculates the matching client position for the given frame position @p point. diff --git a/src/x11window.cpp b/src/x11window.cpp index b159ceedef..6eb0f6daf8 100644 --- a/src/x11window.cpp +++ b/src/x11window.cpp @@ -1156,7 +1156,7 @@ void X11Window::createDecoration(const QRectF &oldgeom) } setDecoration(decoration); - moveResize(QRectF(calculateGravitation(false), implicitSize())); + moveResize(QRectF(calculateGravitation(false), clientSizeToFrameSize(clientSize()))); maybeCreateX11DecorationRenderer(); Q_EMIT geometryShapeChanged(this, oldgeom); } @@ -1168,7 +1168,7 @@ void X11Window::destroyDecoration() QPointF grav = calculateGravitation(true); setDecoration(nullptr); maybeDestroyX11DecorationRenderer(); - moveResize(QRectF(grav, implicitSize())); + moveResize(QRectF(grav, clientSizeToFrameSize(clientSize()))); if (!isZombie()) { Q_EMIT geometryShapeChanged(this, oldgeom); } @@ -2697,6 +2697,15 @@ QRectF X11Window::frameRectToBufferRect(const QRectF &rect) const return frameRectToClientRect(rect); } +/** + * Returns the natural size of the window, if the window is not shaded it's the same + * as size(). + */ +QSizeF X11Window::implicitSize() const +{ + return clientSizeToFrameSize(m_client.geometry().size()); +} + QMatrix4x4 X11Window::inputTransformation() const { QMatrix4x4 matrix; diff --git a/src/x11window.h b/src/x11window.h index b9bca1615e..b0a9a648b0 100644 --- a/src/x11window.h +++ b/src/x11window.h @@ -110,6 +110,7 @@ public: QSizeF frameSizeToClientSize(const QSizeF &size) const override; QSizeF clientSizeToFrameSize(const QSizeF &size) const override; QRectF frameRectToBufferRect(const QRectF &rect) const; + QSizeF implicitSize() const; QMatrix4x4 inputTransformation() const override;