[kcmkwin/rules] Set dynamic property for x11Connection and x11RootWindow

Needed by kwinglobals which gets used internally through DetectWidget.

BUG: 345339
This commit is contained in:
Martin Gräßlin 2015-03-20 08:19:45 +01:00
parent 85d87297b0
commit 305387ec3a

View file

@ -24,6 +24,7 @@
#include <KLocalizedString>
#include <kaboutdata.h>
#include <QtDBus/QtDBus>
#include <QX11Info>
#include "ruleslist.h"
#include <KPluginFactory>
@ -40,6 +41,10 @@ KCMRules::KCMRules(QWidget *parent, const QVariantList &)
: KCModule(parent)
, config("kwinrulesrc")
{
if (QX11Info::isPlatformX11()) {
qApp->setProperty("x11Connection", QVariant::fromValue<void*>(QX11Info::connection()));
qApp->setProperty("x11RootWindow", QVariant::fromValue(QX11Info::appRootWindow()));
}
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setMargin(0);