diff --git a/widget/src/gtk/nsLookAndFeel.cpp b/widget/src/gtk/nsLookAndFeel.cpp index 94fb19f6b96..59b1669ef7c 100644 --- a/widget/src/gtk/nsLookAndFeel.cpp +++ b/widget/src/gtk/nsLookAndFeel.cpp @@ -432,10 +432,13 @@ nsLookAndFeel::InitColors() gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_set_rc_style(accel_label); + gtk_widget_set_rc_style(menu); + gtk_widget_realize(menu); + gtk_widget_realize(accel_label); + style = gtk_widget_get_style(accel_label); sMenuText = GDK_COLOR_TO_NS_RGB(style->fg[GTK_STATE_NORMAL]); - gtk_widget_set_rc_style(menu); style = gtk_widget_get_style(menu); sMenuBackground = GDK_COLOR_TO_NS_RGB(style->bg[GTK_STATE_NORMAL]); @@ -446,13 +449,18 @@ nsLookAndFeel::InitColors() GtkWidget *parent = gtk_fixed_new(); GtkWidget *button = gtk_button_new(); GtkWidget *label = gtk_label_new("M"); + GtkWidget *window = gtk_window_new(GTK_WINDOW_POPUP); gtk_container_add(GTK_CONTAINER(button), label); gtk_container_add(GTK_CONTAINER(parent), button); + gtk_container_add(GTK_CONTAINER(window), parent); gtk_widget_set_rc_style(button); gtk_widget_set_rc_style(label); + gtk_widget_realize(button); + gtk_widget_realize(label); + style = gtk_widget_get_style(label); sButtonText = GDK_COLOR_TO_NS_RGB(style->fg[GTK_STATE_NORMAL]); @@ -463,7 +471,7 @@ nsLookAndFeel::InitColors() sButtonInnerDarkBorder = GDK_COLOR_TO_NS_RGB(style->dark[GTK_STATE_NORMAL]); - gtk_widget_unref(parent); + gtk_widget_destroy(window); }