diff --git a/shell_client.cpp b/shell_client.cpp index 6269ffac77..7170007ea1 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -266,12 +266,19 @@ NET::WindowType ShellClient::windowType(bool direct, int supported_types) const double ShellClient::opacity() const { - return 1.0; + return m_opacity; } void ShellClient::setOpacity(double opacity) { - Q_UNUSED(opacity) + const qreal newOpacity = qBound(0.0, opacity, 1.0); + if (newOpacity == m_opacity) { + return; + } + const qreal oldOpacity = m_opacity; + m_opacity = newOpacity; + addRepaintFull(); + emit opacityChanged(this, oldOpacity); } void ShellClient::addDamage(const QRegion &damage) diff --git a/shell_client.h b/shell_client.h index d7288fd17a..45025f3b5e 100644 --- a/shell_client.h +++ b/shell_client.h @@ -170,6 +170,7 @@ private: bool m_fullScreen = false; bool m_transient = false; bool m_internal; + qreal m_opacity = 1.0; }; }