From 52e25019011ef856809fd4317b197d5d37f56454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 13 Jan 2015 10:45:38 +0100 Subject: [PATCH 4/8] Only install color scheme on toplevel widgets ColorSchemeFilter::installColorScheme sets/deletes an xproperty on the QWidget to be read by the window manager. The window manager is only interested in toplevel widgets and doesn't monitor child windows at all. Thus it is not required to perform this method on non toplevel windows. The method so far created a native window for each QWidget it operated on by calling winId. This broke QQuickWidgets when changing the color scheme as it's not allowed to call QWindow::create on a QQuickWidget. REVIEW: 122024 --- src/kstyle/kstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kstyle/kstyle.cpp b/src/kstyle/kstyle.cpp index b5f7363a27337d706beb73363dc0cffa38762ef4..a6c898a49b4f7597493ee31ef9381b8a8f8887df 100644 --- a/src/kstyle/kstyle.cpp +++ b/src/kstyle/kstyle.cpp @@ -103,7 +103,7 @@ bool ColorSchemeFilter::eventFilter(QObject *object, QEvent *event) void ColorSchemeFilter::installColorScheme(QWidget *w) { - if (!w) { + if (!w || !w->isTopLevel()) { return; } #if HAVE_X11 -- 2.2.2