aboutsummaryrefslogtreecommitdiffstats
path: root/community/qt/qt-gtk-theme-fix.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/qt/qt-gtk-theme-fix.patch')
-rw-r--r--community/qt/qt-gtk-theme-fix.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/community/qt/qt-gtk-theme-fix.patch b/community/qt/qt-gtk-theme-fix.patch
new file mode 100644
index 00000000000..a9e4dc7da47
--- /dev/null
+++ b/community/qt/qt-gtk-theme-fix.patch
@@ -0,0 +1,61 @@
+Author: Timo Teräs <timo.teras@iki.fi>
+
+Fix QT GTK style to use GTK API to get the active theme name. This fixes
+things for non-GNOME setups, as well as realtime theme change detection.
+
+It still tries to detect if GTK-Qt is in use and refuse to run with that
+as it would cause obvious recursion, however that might be not always
+possible.
+
+diff -rup qt-everywhere-opensource-src-4.8.5.orig/src/gui/styles/qgtkstyle_p.cpp qt-everywhere-opensource-src-4.8.5/src/gui/styles/qgtkstyle_p.cpp
+--- qt-everywhere-opensource-src-4.8.5.orig/src/gui/styles/qgtkstyle_p.cpp 2013-06-07 05:16:59.000000000 +0000
++++ qt-everywhere-opensource-src-4.8.5/src/gui/styles/qgtkstyle_p.cpp 2013-09-25 16:37:34.703506640 +0000
+@@ -505,7 +505,7 @@ void QGtkStylePrivate::initGtkWidgets()
+
+ static QString themeName;
+ if (!gtkWidgetMap()->contains("GtkWindow") && themeName.isEmpty()) {
+- themeName = getThemeName();
++ themeName = getThemeNameGuess();
+
+ if (themeName == QLS("Qt") || themeName == QLS("Qt4")) {
+ // Due to namespace conflicts with Qt3 and obvious recursion with Qt4,
+@@ -648,7 +648,7 @@ bool QGtkStylePrivate::getGConfBool(cons
+ return retVal;
+ }
+
+-QString QGtkStylePrivate::getThemeName()
++QString QGtkStylePrivate::getThemeNameGuess()
+ {
+ QString themeName;
+ // We try to parse the gtkrc file first
+@@ -685,6 +685,19 @@ QString QGtkStylePrivate::getThemeName()
+
+ return themeName;
+ }
++
++QString QGtkStylePrivate::getThemeName()
++{
++ QString themeName;
++ gchar *theme_name;
++
++ GtkSettings *settings = gtk_settings_get_default();
++ g_object_get(settings, "gtk-theme-name", &theme_name, NULL);
++ themeName = QString::fromUtf8(theme_name);
++ g_free(theme_name);
++
++ return themeName;
++}
+
+ // Get size of the arrow controls in a GtkSpinButton
+ int QGtkStylePrivate::getSpinboxArrowSize() const
+diff -rup qt-everywhere-opensource-src-4.8.5.orig/src/gui/styles/qgtkstyle_p.h qt-everywhere-opensource-src-4.8.5/src/gui/styles/qgtkstyle_p.h
+--- qt-everywhere-opensource-src-4.8.5.orig/src/gui/styles/qgtkstyle_p.h 2013-06-07 05:16:59.000000000 +0000
++++ qt-everywhere-opensource-src-4.8.5/src/gui/styles/qgtkstyle_p.h 2013-09-25 16:29:11.310167033 +0000
+@@ -338,6 +338,7 @@ public:
+ static bool getGConfBool(const QString &key, bool fallback = 0);
+ static QString getGConfString(const QString &key, const QString &fallback = QString());
+
++ static QString getThemeNameGuess();
+ static QString getThemeName();
+ virtual int getSpinboxArrowSize() const;
+