From 38dbd34c9191c9047d7f6151570ad351f85e17eb Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Thu, 26 Apr 2018 00:04:32 -0400 Subject: css: use parsing-error signal to warn on bad css file or image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to Alberts Muktupāvels for this code --- mate-panel/main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mate-panel/main.c b/mate-panel/main.c index 825ec348..0c98be8b 100644 --- a/mate-panel/main.c +++ b/mate-panel/main.c @@ -55,6 +55,15 @@ static const GOptionEntry options[] = { { NULL } }; +static void +parsing_error_cb (GtkCssProvider *provider, + GtkCssSection *section, + GError *error, + gpointer user_data) +{ + g_warning ("Can't parse mate-panel's CSS custom description: %s\n", error->message); +} + int main (int argc, char **argv) { @@ -178,6 +187,8 @@ main (int argc, char **argv) resource = "/org/mate/panel/theme/mate-panel.css"; priority = GTK_STYLE_PROVIDER_PRIORITY_FALLBACK; + g_signal_connect (provider, "parsing-error", G_CALLBACK (parsing_error_cb), NULL); + gtk_css_provider_load_from_resource (css, resource); gtk_style_context_add_provider_for_screen (screen, provider, priority); -- cgit v1.2.1