diff --git a/shell_client.h b/shell_client.h --- a/shell_client.h +++ b/shell_client.h @@ -215,7 +215,12 @@ KWayland::Server::ShellSurfaceInterface *m_shellSurface; KWayland::Server::XdgShellSurfaceInterface *m_xdgShellSurface; KWayland::Server::XdgShellPopupInterface *m_xdgShellPopup; + + // size of the last buffer QSize m_clientSize; + // last size we requested or empty if we haven't sent an explicit request to the client + // if empty the client should choose their own default size + QSize m_requestedClientSize; struct PendingConfigureRequest { //note for wl_shell we have no serial, so serialId and m_lastAckedConfigureRequest will always be 0 diff --git a/shell_client.cpp b/shell_client.cpp --- a/shell_client.cpp +++ b/shell_client.cpp @@ -313,7 +313,7 @@ if (m_requestGeometryBlockCounter != 0 || areGeometryUpdatesBlocked()) { return; } - m_xdgShellSurface->configure(xdgSurfaceStates()); + m_xdgShellSurface->configure(xdgSurfaceStates(), m_requestedClientSize); }; configure(); connect(this, &AbstractClient::activeChanged, this, configure); @@ -1184,6 +1184,8 @@ configureRequest.maximizeMode = m_requestedMaximizeMode; const QSize size = rect.size() - QSize(borderLeft() + borderRight(), borderTop() + borderBottom()); + m_requestedClientSize = size; + if (m_shellSurface) { m_shellSurface->requestSize(size); } @@ -1262,6 +1264,7 @@ void ShellClient::unmap() { m_unmapped = true; + m_requestedClientSize = QSize(); destroyWindowManagementInterface(); if (Workspace::self()) { addWorkspaceRepaint(visibleRect());