libkwineffects: Introduce windowExpandedGeometryChanged()
This signal can be useful if you want to know when the visible geometry has changed to update cached repaint region during an animation.
This commit is contained in:
parent
c6d2eee3c1
commit
b61c800cee
6 changed files with 26 additions and 15 deletions
|
@ -354,6 +354,9 @@ void EffectsHandlerImpl::setupClientConnections(AbstractClient* c)
|
||||||
emit windowFullScreenChanged(c->effectWindow());
|
emit windowFullScreenChanged(c->effectWindow());
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
connect(c, &AbstractClient::visibleGeometryChanged, this, [this, c]() {
|
||||||
|
emit windowExpandedGeometryChanged(c->effectWindow());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void EffectsHandlerImpl::setupUnmanagedConnections(Unmanaged* u)
|
void EffectsHandlerImpl::setupUnmanagedConnections(Unmanaged* u)
|
||||||
|
@ -364,6 +367,9 @@ void EffectsHandlerImpl::setupUnmanagedConnections(Unmanaged* u)
|
||||||
connect(u, &Unmanaged::frameGeometryChanged, this, &EffectsHandlerImpl::slotFrameGeometryChanged);
|
connect(u, &Unmanaged::frameGeometryChanged, this, &EffectsHandlerImpl::slotFrameGeometryChanged);
|
||||||
connect(u, &Unmanaged::paddingChanged, this, &EffectsHandlerImpl::slotPaddingChanged);
|
connect(u, &Unmanaged::paddingChanged, this, &EffectsHandlerImpl::slotPaddingChanged);
|
||||||
connect(u, &Unmanaged::damaged, this, &EffectsHandlerImpl::slotWindowDamaged);
|
connect(u, &Unmanaged::damaged, this, &EffectsHandlerImpl::slotWindowDamaged);
|
||||||
|
connect(u, &Unmanaged::visibleGeometryChanged, this, [this, u]() {
|
||||||
|
emit windowExpandedGeometryChanged(u->effectWindow());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void EffectsHandlerImpl::reconfigure()
|
void EffectsHandlerImpl::reconfigure()
|
||||||
|
|
|
@ -213,12 +213,8 @@ quint64 AnimationEffect::p_animate( EffectWindow *w, Attribute a, uint meta, int
|
||||||
if (!d->m_isInitialized)
|
if (!d->m_isInitialized)
|
||||||
init(); // needs to ensure the window gets removed if deleted in the same event cycle
|
init(); // needs to ensure the window gets removed if deleted in the same event cycle
|
||||||
if (d->m_animations.isEmpty()) {
|
if (d->m_animations.isEmpty()) {
|
||||||
connect(effects, &EffectsHandler::windowGeometryShapeChanged,
|
connect(effects, &EffectsHandler::windowExpandedGeometryChanged,
|
||||||
this, &AnimationEffect::_expandedGeometryChanged);
|
this, &AnimationEffect::_windowExpandedGeometryChanged);
|
||||||
connect(effects, &EffectsHandler::windowStepUserMovedResized,
|
|
||||||
this, &AnimationEffect::_expandedGeometryChanged);
|
|
||||||
connect(effects, &EffectsHandler::windowPaddingChanged,
|
|
||||||
this, &AnimationEffect::_expandedGeometryChanged);
|
|
||||||
}
|
}
|
||||||
AniMap::iterator it = d->m_animations.find(w);
|
AniMap::iterator it = d->m_animations.find(w);
|
||||||
if (it == d->m_animations.end())
|
if (it == d->m_animations.end())
|
||||||
|
@ -555,12 +551,8 @@ void AnimationEffect::clipWindow(const EffectWindow *w, const AniData &anim, Win
|
||||||
|
|
||||||
void AnimationEffect::disconnectGeometryChanges()
|
void AnimationEffect::disconnectGeometryChanges()
|
||||||
{
|
{
|
||||||
disconnect(effects, &EffectsHandler::windowGeometryShapeChanged,
|
disconnect(effects, &EffectsHandler::windowExpandedGeometryChanged,
|
||||||
this, &AnimationEffect::_expandedGeometryChanged);
|
this, &AnimationEffect::_windowExpandedGeometryChanged);
|
||||||
disconnect(effects, &EffectsHandler::windowStepUserMovedResized,
|
|
||||||
this, &AnimationEffect::_expandedGeometryChanged);
|
|
||||||
disconnect(effects, &EffectsHandler::windowPaddingChanged,
|
|
||||||
this, &AnimationEffect::_expandedGeometryChanged);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -970,9 +962,8 @@ region_creation:
|
||||||
d->m_damageDirty = false;
|
d->m_damageDirty = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimationEffect::_expandedGeometryChanged(KWin::EffectWindow *w, const QRect &old)
|
void AnimationEffect::_windowExpandedGeometryChanged(KWin::EffectWindow *w)
|
||||||
{
|
{
|
||||||
Q_UNUSED(old)
|
|
||||||
Q_D(AnimationEffect);
|
Q_D(AnimationEffect);
|
||||||
AniMap::const_iterator entry = d->m_animations.constFind(w);
|
AniMap::const_iterator entry = d->m_animations.constFind(w);
|
||||||
if (entry != d->m_animations.constEnd()) {
|
if (entry != d->m_animations.constEnd()) {
|
||||||
|
|
|
@ -389,7 +389,7 @@ private Q_SLOTS:
|
||||||
void triggerRepaint();
|
void triggerRepaint();
|
||||||
void _windowClosed( KWin::EffectWindow* w );
|
void _windowClosed( KWin::EffectWindow* w );
|
||||||
void _windowDeleted( KWin::EffectWindow* w );
|
void _windowDeleted( KWin::EffectWindow* w );
|
||||||
void _expandedGeometryChanged(KWin::EffectWindow *w, const QRect &old);
|
void _windowExpandedGeometryChanged(KWin::EffectWindow *w);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static QElapsedTimer s_clock;
|
static QElapsedTimer s_clock;
|
||||||
|
|
|
@ -1845,6 +1845,11 @@ Q_SIGNALS:
|
||||||
*/
|
*/
|
||||||
void sessionStateChanged();
|
void sessionStateChanged();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This signal is emitted when the visible geometry of a window changed.
|
||||||
|
*/
|
||||||
|
void windowExpandedGeometryChanged(KWin::EffectWindow *window);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QVector< EffectPair > loaded_effects;
|
QVector< EffectPair > loaded_effects;
|
||||||
//QHash< QString, EffectFactory* > effect_factories;
|
//QHash< QString, EffectFactory* > effect_factories;
|
||||||
|
|
|
@ -50,6 +50,10 @@ Toplevel::Toplevel()
|
||||||
setupCheckScreenConnection();
|
setupCheckScreenConnection();
|
||||||
connect(this, &Toplevel::bufferGeometryChanged, this, &Toplevel::inputTransformationChanged);
|
connect(this, &Toplevel::bufferGeometryChanged, this, &Toplevel::inputTransformationChanged);
|
||||||
|
|
||||||
|
connect(this, &Toplevel::paddingChanged, this, &Toplevel::visibleGeometryChanged);
|
||||||
|
connect(this, &Toplevel::bufferGeometryChanged, this, &Toplevel::visibleGeometryChanged);
|
||||||
|
connect(this, &Toplevel::frameGeometryChanged, this, &Toplevel::visibleGeometryChanged);
|
||||||
|
|
||||||
// Only for compatibility reasons, drop in the next major release.
|
// Only for compatibility reasons, drop in the next major release.
|
||||||
connect(this, &Toplevel::frameGeometryChanged, this, &Toplevel::geometryChanged);
|
connect(this, &Toplevel::frameGeometryChanged, this, &Toplevel::geometryChanged);
|
||||||
}
|
}
|
||||||
|
|
|
@ -665,6 +665,11 @@ Q_SIGNALS:
|
||||||
*/
|
*/
|
||||||
void clientGeometryChanged(KWin::Toplevel *toplevel, const QRect &oldGeometry);
|
void clientGeometryChanged(KWin::Toplevel *toplevel, const QRect &oldGeometry);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This signal is emitted when the visible geometry has changed.
|
||||||
|
*/
|
||||||
|
void visibleGeometryChanged();
|
||||||
|
|
||||||
protected Q_SLOTS:
|
protected Q_SLOTS:
|
||||||
/**
|
/**
|
||||||
* Checks whether the screen number for this Toplevel changed and updates if needed.
|
* Checks whether the screen number for this Toplevel changed and updates if needed.
|
||||||
|
|
Loading…
Reference in a new issue