From 89a4df651d22faa3c5de67999340c1037418975b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 28 Oct 2015 11:16:48 +0100 Subject: [PATCH] [wayland] Sync resizes Similar to X11 world: we send a sync request on each size change and block till we get the next damage with the proper size. Testing seems to show a very smooth resize experience. We automatically sync to the resize speed of the client. Maybe we need a timeout in case the client isn't able to resize to the requested size. --- shell_client.cpp | 10 ++++++++++ shell_client.h | 2 ++ utils.h | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/shell_client.cpp b/shell_client.cpp index 02504f700c..ee622b0d56 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -739,4 +739,14 @@ QPoint ShellClient::transientPlacementHint() const return m_shellSurface->transientOffset(); } +bool ShellClient::isWaitingForMoveResizeSync() const +{ + return m_positionAfterResize.isValid(); +} + +void ShellClient::doResizeSync() +{ + requestGeometry(moveResizeGeometry()); +} + } diff --git a/shell_client.h b/shell_client.h index 8d21b17cf9..fee22c459a 100644 --- a/shell_client.h +++ b/shell_client.h @@ -122,6 +122,8 @@ protected: void setGeometryRestore(const QRect &geo) override { m_geomMaximizeRestore = geo; } + void doResizeSync() override; + bool isWaitingForMoveResizeSync() const override; private Q_SLOTS: void clientFullScreenChanged(bool fullScreen); diff --git a/utils.h b/utils.h index b1a55cacc0..3ec977bc75 100644 --- a/utils.h +++ b/utils.h @@ -206,7 +206,7 @@ static inline int bitCount(uint32_t mask) class ClearablePoint { public: - inline bool isValid() { + inline bool isValid() const { return m_valid; }