Honor animationsSupported in minimize, slide and sliding popups effects

Differential Revision: https://phabricator.kde.org/D8938
This commit is contained in:
Kai Uwe Broulik 2017-11-23 10:34:06 +01:00
parent 1c61e61119
commit 11e95d5de1
7 changed files with 24 additions and 3 deletions

View file

@ -378,7 +378,7 @@ EFFECT_FALLBACK
false,
#ifdef EFFECT_BUILTINS
&createHelper<MinimizeAnimationEffect>,
nullptr,
&MinimizeAnimationEffect::supported,
nullptr
#endif
EFFECT_FALLBACK
@ -528,7 +528,7 @@ EFFECT_FALLBACK
false,
#ifdef EFFECT_BUILTINS
&createHelper<SlideEffect>,
nullptr,
&SlideEffect::supported,
nullptr
#endif
EFFECT_FALLBACK
@ -558,7 +558,7 @@ EFFECT_FALLBACK
false,
#ifdef EFFECT_BUILTINS
&createHelper<SlidingPopupsEffect>,
nullptr,
&SlidingPopupsEffect::supported,
nullptr
#endif
EFFECT_FALLBACK

View file

@ -33,6 +33,10 @@ MinimizeAnimationEffect::MinimizeAnimationEffect()
connect(effects, SIGNAL(windowUnminimized(KWin::EffectWindow*)), this, SLOT(slotWindowUnminimized(KWin::EffectWindow*)));
}
bool MinimizeAnimationEffect::supported()
{
return effects->animationsSupported();
}
void MinimizeAnimationEffect::prePaintScreen(ScreenPrePaintData& data, int time)
{

View file

@ -49,6 +49,8 @@ public:
return 50;
}
static bool supported();
public Q_SLOTS:
void slotWindowDeleted(KWin::EffectWindow *w);
void slotWindowMinimized(KWin::EffectWindow *w);

View file

@ -38,6 +38,11 @@ SlideEffect::SlideEffect()
reconfigure(ReconfigureAll);
}
bool SlideEffect::supported()
{
return effects->animationsSupported();
}
void SlideEffect::reconfigure(ReconfigureFlags)
{
mTimeLine.setDuration(animationTime(250));

View file

@ -47,6 +47,8 @@ public:
return 50;
}
static bool supported();
private Q_SLOTS:
void slotDesktopChanged(int old, int current);

View file

@ -61,6 +61,11 @@ SlidingPopupsEffect::~SlidingPopupsEffect()
{
}
bool SlidingPopupsEffect::supported()
{
return effects->animationsSupported();
}
void SlidingPopupsEffect::reconfigure(ReconfigureFlags flags)
{
Q_UNUSED(flags)

View file

@ -48,6 +48,9 @@ public:
int requestedEffectChainPosition() const override {
return 40;
}
static bool supported();
// TODO react also on virtual desktop changes
// for properties