diff --git a/clients/aurorae/src/aurorae.cpp b/clients/aurorae/src/aurorae.cpp index b6c219b72f..ccbb1cb6eb 100644 --- a/clients/aurorae/src/aurorae.cpp +++ b/clients/aurorae/src/aurorae.cpp @@ -25,6 +25,7 @@ along with this program. If not, see . #include #include #include +#include #include #include @@ -576,6 +577,18 @@ void AuroraeClient::slotAlphaChanged() } } +bool AuroraeClient::animationsSupported() const +{ + if (!compositingActive()) { + return false; + } + QPixmap pix(1,1); + QPainter p(&pix); + const bool raster = p.paintEngine()->type() == QPaintEngine::Raster; + p.end(); + return raster; +} + } // namespace Aurorae extern "C" diff --git a/clients/aurorae/src/aurorae.h b/clients/aurorae/src/aurorae.h index 6e187eaeb9..207a400ccb 100644 --- a/clients/aurorae/src/aurorae.h +++ b/clients/aurorae/src/aurorae.h @@ -110,6 +110,7 @@ class AuroraeClient : public KDecorationUnstable Q_PROPERTY(int width READ width) Q_PROPERTY(qulonglong windowId READ windowId CONSTANT) Q_PROPERTY(int doubleClickInterval READ doubleClickInterval) + Q_PROPERTY(bool animationsSupported READ animationsSupported CONSTANT) // TODO: window tabs - they suck for dynamic features public: AuroraeClient(KDecorationBridge* bridge, KDecorationFactory* factory); @@ -132,6 +133,8 @@ public: bool isMaximized() const; int doubleClickInterval() const; + bool animationsSupported() const; + Q_INVOKABLE QVariant readConfig(const QString &key, const QVariant &defaultValue = QVariant()); Q_SIGNALS: diff --git a/clients/aurorae/themes/plastik/package/contents/ui/main.qml b/clients/aurorae/themes/plastik/package/contents/ui/main.qml index d18d7a78e7..fe91a6a524 100644 --- a/clients/aurorae/themes/plastik/package/contents/ui/main.qml +++ b/clients/aurorae/themes/plastik/package/contents/ui/main.qml @@ -59,7 +59,10 @@ Decoration { } root.animateButtons = decoration.readConfig("animateButtons", true); root.titleShadow = decoration.readConfig("titleShadow", true); - root.animationDuration = 150; + if (decoration.animationsSupported) { + root.animationDuration = 150; + root.animateButtons = false; + } } ColorHelper { id: colorHelper