summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2018-04-26 00:04:32 -0400
committerraveit65 <[email protected]>2018-04-26 13:06:06 +0200
commitf51051bce81b8284311661711d5d3cf36321560a (patch)
treefd4f6701c49aeb82e8408a79571ededb9a6d9ca1
parent3db6772bd564fc2c592b61853b870dd8c9dc5e1b (diff)
downloadmate-panel-f51051bce81b8284311661711d5d3cf36321560a.tar.bz2
mate-panel-f51051bce81b8284311661711d5d3cf36321560a.tar.xz
css: use parsing-error signal to warn on bad css file or image
Thanks to Alberts Muktupāvels for this code
-rw-r--r--mate-panel/main.c11
1 files changed, 11 insertions, 0 deletions
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);