Add support for opacity in ShellClient

icc-effect-5.14.5
Martin Gräßlin 2016-02-18 08:27:02 +01:00
parent f8f13a7fba
commit ba7c5bbd77
2 changed files with 10 additions and 2 deletions

View File

@ -266,12 +266,19 @@ NET::WindowType ShellClient::windowType(bool direct, int supported_types) const
double ShellClient::opacity() const double ShellClient::opacity() const
{ {
return 1.0; return m_opacity;
} }
void ShellClient::setOpacity(double 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) void ShellClient::addDamage(const QRegion &damage)

View File

@ -170,6 +170,7 @@ private:
bool m_fullScreen = false; bool m_fullScreen = false;
bool m_transient = false; bool m_transient = false;
bool m_internal; bool m_internal;
qreal m_opacity = 1.0;
}; };
} }