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
This commit is contained in:
Hugo Pereira Da Costa 2009-06-26 03:19:22 +00:00
parent 3d54acecf2
commit d26e3a64c4

View file

@ -23,6 +23,8 @@
#include <klocale.h>
#include <kconfig.h>
#include <kglobal.h>
#include <QDBusMessage>
#include <QDBusConnection>
#include <QLabel>
#include <QStyle>
//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()