void renderAllBackgrounds(GtkStyleContext* a_StyleContext, cairo_t* a_Cairo)
{
	GtkStyleContext* parentStyleContext = gtk_style_context_get_parent(a_StyleContext);
	if (parentStyleContext)
		renderAllBackgrounds(parentStyleContext, a_Cairo);

	gtk_render_background(a_StyleContext, a_Cairo, -50, -50, 100, 100);
}
Beispiel #2
0
static void StyleContextFree(GtkStyleContext* sc)
{
    if (gtk_check_version(3,16,0) == NULL || gtk_check_version(3,4,0))
    {
        g_object_unref(sc);
        return;
    }
#if GTK_CHECK_VERSION(3,4,0)
    // GTK+ < 3.16 does not properly handle freeing child context before parent
    do {
        GtkStyleContext* parent = gtk_style_context_get_parent(sc);
        if (parent)
        {
            g_object_ref(parent);
            gtk_style_context_set_parent(sc, NULL);
        }
        g_object_unref(sc);
        sc = parent;
    } while (sc);
#endif
}