From d26e3a64c49773b78146c7c79e4c7a7cc0fc53bd Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Fri, 26 Jun 2009 03:19:22 +0000 Subject: [PATCH] Backport r987422: Added dbus call to get whether kwin compositing is enabled or not, rather than systematically returning false. This enables nicer painting of decoration previews. svn path=/branches/KDE/4.3/kdebase/workspace/; revision=987424 --- kcmkwin/kwindecoration/preview.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/kcmkwin/kwindecoration/preview.cpp b/kcmkwin/kwindecoration/preview.cpp index 8284127a53..e52ba37dbb 100644 --- a/kcmkwin/kwindecoration/preview.cpp +++ b/kcmkwin/kwindecoration/preview.cpp @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include #include //Added by qt3to4: @@ -440,7 +442,20 @@ void KDecorationPreviewBridge::grabXServer( bool ) bool KDecorationPreviewBridge::compositingActive() const { - return false; + + QDBusMessage message = QDBusMessage::createMethodCall( "org.kde.kwin", "/KWin", "org.kde.KWin", "compositingActive" ); + QDBusMessage reply = QDBusConnection::sessionBus().call( message ); + if( reply.type() != QDBusMessage::ReplyMessage ) + { + return false; + } + + if( reply.arguments().empty() ) { + return false; + } + + return reply.arguments()[0].toBool(); + } KDecorationPreviewOptions::KDecorationPreviewOptions()