Bug 972382 - [GTK3] Theme is not loaded in other WM's (MATE, XFCE and so). r=karlt
authorMartin Stransky <stransky@redhat.com>
Mon, 24 Feb 2014 10:09:55 -0500
changeset 170229 b3b8d728624319ccb3d51f3ad3a3e6caaaa37cbe
parent 170228 195910dc76049b34fb42fbd196df73a64955a31f
child 170230 5fa7f5df67b342839cef5a928dd43d1eec9a1902
push id26283
push userkwierso@gmail.com
push dateTue, 25 Feb 2014 01:45:31 +0000
treeherdermozilla-central@e3daaa4c73dd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs972382
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 972382 - [GTK3] Theme is not loaded in other WM's (MATE, XFCE and so). r=karlt
widget/gtk/nsLookAndFeel.cpp
--- a/widget/gtk/nsLookAndFeel.cpp
+++ b/widget/gtk/nsLookAndFeel.cpp
@@ -941,16 +941,21 @@ nsLookAndFeel::Init()
         sMenuHoverText = GDK_COLOR_TO_NS_RGB(style->fg[GTK_STATE_PRELIGHT]);
     }
 
     g_object_unref(menu);
 #else
     GdkRGBA color;
     GtkStyleContext *style;
 
+    // Gtk manages a screen's CSS in the settings object so we
+    // ask Gtk to create it explicitly. Otherwise we may end up 
+    // with wrong color theme, see Bug 972382
+    (void)gtk_settings_get_for_screen(gdk_screen_get_default());
+
     GtkWidgetPath *path = gtk_widget_path_new();
     gtk_widget_path_append_type(path, GTK_TYPE_WINDOW);
 
     mBackgroundStyle = create_context(path);
     gtk_style_context_add_class(mBackgroundStyle, GTK_STYLE_CLASS_BACKGROUND);
 
     mViewStyle = create_context(path);
     gtk_style_context_add_class(mViewStyle, GTK_STYLE_CLASS_VIEW);