From 8855f47f34df6226d302a08a248e553ec9e97cc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Tue, 12 May 2015 21:32:07 +0200 Subject: [PATCH] lazy setting of xbc properties on qApp just a wild guess - the crashes showed up somewhen after the early setting of the property/ X11Info access - if this indeed is the cause, they should disappear or only appear after actually using the detect button. We'll see. CCBUG: 346748 REVIEW: 123777 --- kcmkwin/kwinrules/detectwidget.cpp | 2 ++ kcmkwin/kwinrules/kcm.cpp | 4 ---- kcmkwin/kwinrules/main.cpp | 4 ---- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/kcmkwin/kwinrules/detectwidget.cpp b/kcmkwin/kwinrules/detectwidget.cpp index b9b049e8f5..2e855b30a2 100644 --- a/kcmkwin/kwinrules/detectwidget.cpp +++ b/kcmkwin/kwinrules/detectwidget.cpp @@ -171,6 +171,8 @@ QByteArray DetectDialog::selectedMachine() const void DetectDialog::selectWindow() { if (!KWin::Cursor::self()) { + qApp->setProperty("x11Connection", QVariant::fromValue(QX11Info::connection())); + qApp->setProperty("x11RootWindow", QVariant::fromValue(QX11Info::appRootWindow())); KWin::Cursor::create(this); } // use a dialog, so that all user input is blocked diff --git a/kcmkwin/kwinrules/kcm.cpp b/kcmkwin/kwinrules/kcm.cpp index bb3efc4df6..ca0fe5056c 100644 --- a/kcmkwin/kwinrules/kcm.cpp +++ b/kcmkwin/kwinrules/kcm.cpp @@ -41,10 +41,6 @@ KCMRules::KCMRules(QWidget *parent, const QVariantList &) : KCModule(parent) , config("kwinrulesrc") { - if (QX11Info::isPlatformX11()) { - qApp->setProperty("x11Connection", QVariant::fromValue(QX11Info::connection())); - qApp->setProperty("x11RootWindow", QVariant::fromValue(QX11Info::appRootWindow())); - } QVBoxLayout *layout = new QVBoxLayout(this); layout->setMargin(0); diff --git a/kcmkwin/kwinrules/main.cpp b/kcmkwin/kwinrules/main.cpp index 4b66eb366f..c9e80d2ca8 100644 --- a/kcmkwin/kwinrules/main.cpp +++ b/kcmkwin/kwinrules/main.cpp @@ -245,10 +245,6 @@ KWIN_EXPORT int kdemain(int argc, char* argv[]) app.setApplicationDisplayName(i18n("KWin")); app.setApplicationName("kwin_rules_dialog"); app.setApplicationVersion("1.0"); - if (QX11Info::isPlatformX11()) { - app.setProperty("x11Connection", QVariant::fromValue(QX11Info::connection())); - app.setProperty("x11RootWindow", QVariant::fromValue(QX11Info::appRootWindow())); - } bool whole_app = false; bool id_ok = false; Window id = None;