From 5fe6de699ca0cad9934197b317c93bcc4f41b117 Mon Sep 17 00:00:00 2001 From: David Redondo Date: Wed, 7 Jul 2021 13:50:02 +0200 Subject: [PATCH] Handle when a xdg-toplevel changes its min or max size We previously never emitted maximiziableChanged() meaning we never synced the state to the decoration. BUG:439578 --- src/xdgshellclient.cpp | 14 ++++++++++++++ src/xdgshellclient.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/src/xdgshellclient.cpp b/src/xdgshellclient.cpp index d21d108289..c0053b4167 100644 --- a/src/xdgshellclient.cpp +++ b/src/xdgshellclient.cpp @@ -393,6 +393,10 @@ XdgToplevelClient::XdgToplevelClient(XdgToplevelInterface *shellSurface) this, &XdgToplevelClient::initialize); connect(shellSurface, &XdgToplevelInterface::destroyed, this, &XdgToplevelClient::destroyClient); + connect(shellSurface, &XdgToplevelInterface::maximumSizeChanged, + this, &XdgToplevelClient::handleMaximumSizeChanged); + connect(shellSurface, &XdgToplevelInterface::minimumSizeChanged, + this, &XdgToplevelClient::handleMinimumSizeChanged); connect(shellSurface->shell(), &XdgShellInterface::pingTimeout, this, &XdgToplevelClient::handlePingTimeout); connect(shellSurface->shell(), &XdgShellInterface::pingDelayed, @@ -1148,6 +1152,16 @@ void XdgToplevelClient::handlePongReceived(quint32 serial) setUnresponsive(false); } +void XdgToplevelClient::handleMaximumSizeChanged() +{ + Q_EMIT maximizeableChanged(isMaximizable()); +} + +void XdgToplevelClient::handleMinimumSizeChanged() +{ + Q_EMIT maximizeableChanged(isMaximizable()); +} + void XdgToplevelClient::sendPing(PingReason reason) { XdgShellInterface *shell = m_shellSurface->shell(); diff --git a/src/xdgshellclient.h b/src/xdgshellclient.h index 7e02b6ad01..c619506df7 100644 --- a/src/xdgshellclient.h +++ b/src/xdgshellclient.h @@ -185,6 +185,8 @@ private: void handlePingTimeout(quint32 serial); void handlePingDelayed(quint32 serial); void handlePongReceived(quint32 serial); + void handleMaximumSizeChanged(); + void handleMinimumSizeChanged(); void initialize(); void updateMaximizeMode(MaximizeMode maximizeMode); void updateFullScreenMode(bool set);