stylecontext: Don't crah when invalidate() is called on saved context
We need to invalidate the root node, not the current one. Fixes crashes on startup of eclipse. Testcase included. https://bugzilla.redhat.com/show_bug.cgi?id=1185828
This commit is contained in:
@ -289,6 +289,24 @@ test_basic_properties (void)
|
||||
g_object_unref (context);
|
||||
}
|
||||
|
||||
void
|
||||
test_invalidate_saved (void)
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkStyleContext *context;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
|
||||
context = gtk_widget_get_style_context (window);
|
||||
gtk_style_context_save (context);
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_style_context_invalidate (context);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
gtk_style_context_restore (context);
|
||||
|
||||
gtk_widget_destroy (window);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
@ -299,6 +317,7 @@ main (int argc, char *argv[])
|
||||
g_test_add_func ("/style/path", test_path);
|
||||
g_test_add_func ("/style/match", test_match);
|
||||
g_test_add_func ("/style/basic", test_basic_properties);
|
||||
g_test_add_func ("/style/invalidate-saved", test_invalidate_saved);
|
||||
|
||||
return g_test_run ();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user