Add a debug flag for CSS deprecations

It seems better not to spam everybody with this all the time.
This commit is contained in:
Matthias Clasen 2024-05-19 22:04:00 -04:00
parent 7c39b2cea3
commit b603479fe2
3 changed files with 8 additions and 4 deletions

View File

@ -184,6 +184,8 @@ gtk_css_provider_parsing_error (GtkCssProvider *provider,
{
char *s = gtk_css_section_to_string (section);
if (GTK_DEBUG_CHECK (CSS) ||
!g_error_matches (error, GTK_CSS_PARSER_WARNING, GTK_CSS_PARSER_WARNING_DEPRECATED))
g_warning ("Theme parser %s: %s: %s",
error->domain == GTK_CSS_PARSER_WARNING ? "warning" : "error",
s,

View File

@ -96,6 +96,7 @@ typedef enum {
GTK_DEBUG_A11Y = 1 << 17,
GTK_DEBUG_ICONFALLBACK = 1 << 18,
GTK_DEBUG_INVERT_TEXT_DIR = 1 << 19,
GTK_DEBUG_CSS = 1 << 20,
} GtkDebugFlags;
#define GTK_DEBUG_CHECK(type) G_UNLIKELY (gtk_get_debug_flags () & GTK_DEBUG_##type)

View File

@ -200,6 +200,7 @@ static const GdkDebugKey gtk_debug_keys[] = {
{ "accessibility", GTK_DEBUG_A11Y, "Information about accessibility state changes" },
{ "iconfallback", GTK_DEBUG_ICONFALLBACK, "Information about icon fallback" },
{ "invert-text-dir", GTK_DEBUG_INVERT_TEXT_DIR, "Invert the default text direction" },
{ "css", GTK_DEBUG_CSS, "Information about deprecated CSS features" },
};
/* This checks to see if the process is running suid or sgid