cssstyle: Don't store custom css properties

This makes custom CSS properties no longer configurable. But it avoids
crashes when loading custom themes, so that's a good thing.

Testcase included.

https://bugzilla.redhat.com/show_bug.cgi?id=1281234
This commit is contained in:
Benjamin Otte
2015-11-20 19:37:52 +01:00
parent 6489ec440f
commit d75989a52b
5 changed files with 45 additions and 24 deletions

View File

@ -407,6 +407,29 @@ test_style_classes (void)
g_object_unref (context);
}
void
test_new_css_property (void)
{
GtkWidget *widget;
GtkStyleContext *context;
GtkBorder padding;
widget = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_realize (widget);
context = gtk_widget_get_style_context (widget);
gtk_style_context_get_padding (context, gtk_style_context_get_state (context), &padding);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_style_properties_register_property (NULL,
g_param_spec_int ("test", "test", "test",
0, G_MAXINT, 42, G_PARAM_READWRITE));
G_GNUC_END_IGNORE_DEPRECATIONS;
gtk_style_context_add_class (context, "nonexisting");
gtk_style_context_get_padding (context, gtk_style_context_get_state (context), &padding);
}
int
main (int argc, char *argv[])
{
@ -421,6 +444,7 @@ main (int argc, char *argv[])
g_test_add_func ("/style/set-widget-path-saved", test_set_widget_path_saved);
g_test_add_func ("/style/widget-path-parent", test_widget_path_parent);
g_test_add_func ("/style/classes", test_style_classes);
g_test_add_func ("/style/new-css-property", test_new_css_property);
return g_test_run ();
}