diff options
authorDavid Edmundson <[email protected]>2018-10-10 12:03:22 +0100
committerDavid Edmundson <[email protected]>2018-10-10 12:32:53 +0100
commit51a727fc6b0652712a09fb167187b36123dbcc5a (patch)
parentb1b1360ec3fb0ddddcfed2d3db90985cf8495aa8 (diff)
Send requested size in all configure events
Summary: Previously when updating the state we would send a configure event with the size 0,0. This means the client chooses the size. For regular window this works as most toolkits treat this to mean the size that we previously requested. It's not explicit in the spec either way. For maximised windows it's a problem, the spec clearly states that when maximised clients must follow the size given. Telling the client to be 0,0 doesn't make sense. By always sending our last requested size we remove any ambiguity. Test Plan: Ran Maximised some windows and changed focus WAYLAND_DEBUG showed we weren't sending a configure with 0,0 after startup Reviewers: #kwin, zzag Reviewed By: #kwin, zzag Subscribers: zzag, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D16055
2 files changed, 9 insertions, 1 deletions
diff --git a/shell_client.cpp b/shell_client.cpp
index af019c7..7a2387b 100644
--- a/shell_client.cpp
+++ b/shell_client.cpp
@@ -313,7 +313,7 @@ void ShellClient::init()
if (m_requestGeometryBlockCounter != 0 || areGeometryUpdatesBlocked()) {
- m_xdgShellSurface->configure(xdgSurfaceStates());
+ m_xdgShellSurface->configure(xdgSurfaceStates(), m_requestedClientSize);
connect(this, &AbstractClient::activeChanged, this, configure);
@@ -1184,6 +1184,8 @@ void ShellClient::requestGeometry(const QRect &rect)
configureRequest.maximizeMode = m_requestedMaximizeMode;
const QSize size = rect.size() - QSize(borderLeft() + borderRight(), borderTop() + borderBottom());
+ m_requestedClientSize = size;
if (m_shellSurface) {
@@ -1262,6 +1264,7 @@ void ShellClient::resizeWithChecks(int w, int h, ForceGeometry_t force)
void ShellClient::unmap()
m_unmapped = true;
+ m_requestedClientSize = QSize();
if (Workspace::self()) {
diff --git a/shell_client.h b/shell_client.h
index 4c28e92..a29a623 100644
--- a/shell_client.h
+++ b/shell_client.h
@@ -215,7 +215,12 @@ private:
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