From 74da0bb701d63578e31357d105554af14ce76a0b Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 17 Aug 2020 10:51:55 +0300 Subject: [PATCH] Provide default implementation for AbstractClient::updateDecoration() Not all client types support server-side decorations, for example it's typically the case for popup windows. This change provides a default implementation for the updateDecoration() method in order to reduce the amount of boilerplate code in client types that have no support for ssd. --- abstract_client.cpp | 7 +++++++ abstract_client.h | 2 +- xdgshellclient.cpp | 6 ------ xdgshellclient.h | 1 - 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/abstract_client.cpp b/abstract_client.cpp index e69a35bdb5..a7f4dfaeb7 100644 --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -3451,4 +3451,11 @@ void AbstractClient::changeMaximize(bool horizontal, bool vertical, bool adjust) qCWarning(KWIN_CORE, "%s doesn't support setting maximized state", metaObject()->className()); } +void AbstractClient::updateDecoration(bool check_workspace_pos, bool force) +{ + Q_UNUSED(check_workspace_pos) + Q_UNUSED(force) + qCWarning(KWIN_CORE, "%s doesn't support server side decorations", metaObject()->className()); +} + } diff --git a/abstract_client.h b/abstract_client.h index c3b011da25..2afe0cd807 100644 --- a/abstract_client.h +++ b/abstract_client.h @@ -723,7 +723,7 @@ public: /** * TODO: fix boolean traps */ - virtual void updateDecoration(bool check_workspace_pos, bool force = false) = 0; + virtual void updateDecoration(bool check_workspace_pos, bool force = false); /** * Returns whether the window provides context help or not. If it does, diff --git a/xdgshellclient.cpp b/xdgshellclient.cpp index f07557ad43..606ecc7481 100644 --- a/xdgshellclient.cpp +++ b/xdgshellclient.cpp @@ -2027,12 +2027,6 @@ void XdgPopupClient::setNoBorder(bool set) Q_UNUSED(set) } -void XdgPopupClient::updateDecoration(bool check_workspace_pos, bool force) -{ - Q_UNUSED(check_workspace_pos) - Q_UNUSED(force) -} - void XdgPopupClient::showOnScreenEdge() { } diff --git a/xdgshellclient.h b/xdgshellclient.h index 8892f230d9..49c92647ff 100644 --- a/xdgshellclient.h +++ b/xdgshellclient.h @@ -249,7 +249,6 @@ public: bool noBorder() const override; bool userCanSetNoBorder() const override; void setNoBorder(bool set) override; - void updateDecoration(bool check_workspace_pos, bool force = false) override; void showOnScreenEdge() override; bool wantsInput() const override; bool takeFocus() override;