From fb5790e1b1d4ddeac19a2996c806744509de4ac8 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 2 Apr 2009 19:09:52 +0200 Subject: Only set system style when it actually changes This issue would cause Qt Creator and similar apps with proxy styles to loose their custom styling whenever any x11 system settings changed. This happened because we would re-read the settings and override the system style even if the system style did not actually change would be set on the application. We Task-number: 250199 Reviewed-by: ogoffart --- src/gui/kernel/qapplication_x11.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index 6babda9..260a9a4 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -887,11 +887,15 @@ bool QApplicationPrivate::x11_apply_settings() } } + static QString currentStyleName = stylename; if (QCoreApplication::startingUp()) { if (!stylename.isEmpty() && !QApplicationPrivate::styleOverride) QApplicationPrivate::styleOverride = new QString(stylename); } else { - QApplication::setStyle(stylename); + if (currentStyleName != stylename) { + currentStyleName = stylename; + QApplication::setStyle(stylename); + } } int num = -- cgit v0.12