Make GtkCssProvider API less confusing
People almost never get the API for adding application/library CSS right.
gtk_style_context_add_provider
/gtk_style_context_remove_provider
never work how people expect them to work. Using them on e.g. the style context of a button and using the button{}
selector does not actually apply to that button IIRC. Applications could certainly live with just using gtk_style_context_add_provider_for_display
. I'm however not sure what libraries would have to do, or what they do today.
GtkCssProvider
is also not immutable. This causes several issues and bug reports from confused users trying to just reuse one and the same style provider over and over again which doesn't work. This goes so far that some people even just call gtk_css_provider_get_default()
and use that style provider to add application CSS. We should either make them immutable (which I would prefer) or fix the bugs with the current implementation. I don't see a strong reason for not just making them immutable (at least after they are added to a style context), though.