From c3978f197b74ddd5895664c99650a95ca8dcd363 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Fri, 28 May 2021 08:19:23 +0300 Subject: [PATCH] x11: Properly detect the case where client window moves inside frame window If the window borders change in such a way that the buffer geometry doesn't change, but the client geometry does change, we need to configure the wrapper window and maybe the client window so there are no black borders, etc. --- src/x11client.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/x11client.cpp b/src/x11client.cpp index dace87966c..dd147859f6 100644 --- a/src/x11client.cpp +++ b/src/x11client.cpp @@ -4109,7 +4109,12 @@ void X11Client::updateServerGeometry() { const QRect oldBufferGeometry = m_bufferGeometryBeforeUpdateBlocking; - if (oldBufferGeometry.size() != m_bufferGeometry.size()) { + // Compute the old client rect, the client geometry is always inside the buffer geometry. + QRect oldClientRect = m_clientGeometryBeforeUpdateBlocking; + oldClientRect.translate(-m_bufferGeometryBeforeUpdateBlocking.topLeft()); + + if (oldBufferGeometry.size() != m_bufferGeometry.size() || + oldClientRect != QRect(clientPos(), clientSize())) { resizeDecoration(); // If the client is being interactively resized, then the frame window, the wrapper window, // and the client window have correct geometry at this point, so we don't have to configure