Commit b36b3c67 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Provide default implementation for noborder functionality

This change adds a default implementation for no border functionality
in order to reduce the amount of boilerplate code in client sub-classes
that have no support for server-side decorations.
parent 74da0bb7
...@@ -3458,4 +3458,20 @@ void AbstractClient::updateDecoration(bool check_workspace_pos, bool force) ...@@ -3458,4 +3458,20 @@ void AbstractClient::updateDecoration(bool check_workspace_pos, bool force)
qCWarning(KWIN_CORE, "%s doesn't support server side decorations", metaObject()->className()); qCWarning(KWIN_CORE, "%s doesn't support server side decorations", metaObject()->className());
} }
bool AbstractClient::noBorder() const
{
return true;
}
bool AbstractClient::userCanSetNoBorder() const
{
return false;
}
void AbstractClient::setNoBorder(bool set)
{
Q_UNUSED(set)
qCWarning(KWIN_CORE, "%s doesn't support setting decorations", metaObject()->className());
}
} }
...@@ -492,8 +492,8 @@ public: ...@@ -492,8 +492,8 @@ public:
* Sets the maximization according to @p vertically and @p horizontally. * Sets the maximization according to @p vertically and @p horizontally.
*/ */
Q_INVOKABLE void setMaximize(bool vertically, bool horizontally); Q_INVOKABLE void setMaximize(bool vertically, bool horizontally);
virtual bool noBorder() const = 0; virtual bool noBorder() const;
virtual void setNoBorder(bool set) = 0; virtual void setNoBorder(bool set);
virtual void blockActivityUpdates(bool b = true) = 0; virtual void blockActivityUpdates(bool b = true) = 0;
QPalette palette() const; QPalette palette() const;
const Decoration::DecorationPalette *decorationPalette() const; const Decoration::DecorationPalette *decorationPalette() const;
...@@ -528,7 +528,7 @@ public: ...@@ -528,7 +528,7 @@ public:
virtual bool isMinimizable() const; virtual bool isMinimizable() const;
virtual QRect iconGeometry() const; virtual QRect iconGeometry() const;
virtual bool userCanSetFullScreen() const; virtual bool userCanSetFullScreen() const;
virtual bool userCanSetNoBorder() const = 0; virtual bool userCanSetNoBorder() const;
virtual void checkNoBorder(); virtual void checkNoBorder();
virtual void setOnActivities(QStringList newActivitiesList); virtual void setOnActivities(QStringList newActivitiesList);
virtual void setOnAllActivities(bool set) = 0; virtual void setOnAllActivities(bool set) = 0;
......
...@@ -2012,21 +2012,6 @@ void XdgPopupClient::closeWindow() ...@@ -2012,21 +2012,6 @@ void XdgPopupClient::closeWindow()
{ {
} }
bool XdgPopupClient::noBorder() const
{
return true;
}
bool XdgPopupClient::userCanSetNoBorder() const
{
return false;
}
void XdgPopupClient::setNoBorder(bool set)
{
Q_UNUSED(set)
}
void XdgPopupClient::showOnScreenEdge() void XdgPopupClient::showOnScreenEdge()
{ {
} }
......
...@@ -246,9 +246,6 @@ public: ...@@ -246,9 +246,6 @@ public:
QRect transientPlacement(const QRect &bounds) const override; QRect transientPlacement(const QRect &bounds) const override;
bool isCloseable() const override; bool isCloseable() const override;
void closeWindow() override; void closeWindow() override;
bool noBorder() const override;
bool userCanSetNoBorder() const override;
void setNoBorder(bool set) override;
void showOnScreenEdge() override; void showOnScreenEdge() override;
bool wantsInput() const override; bool wantsInput() const override;
bool takeFocus() override; bool takeFocus() override;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment