Commit 08fce80b authored by Martin Flöser's avatar Martin Flöser
Browse files

Disable animations in Plastik for native or non-compositing

Adding a new property on whether we want animations based on whether we
are on raster or with Compositing. The property is constant as the deco
gets recreated on compositing change state anyway.

REVIEW: 109456
BUG: 314532
FIXED-IN: 4.10.2
parent bbb40880
......@@ -25,6 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QtDeclarative/QDeclarativeEngine>
#include <QtDeclarative/QDeclarativeItem>
#include <QtGui/QGraphicsView>
#include <QPaintEngine>
#include <KConfig>
#include <KConfigGroup>
......@@ -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"
......
......@@ -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:
......
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment