Skip to content

Commit 38dbd34

Browse files
lukefromdcraveit65
authored andcommitted
css: use parsing-error signal to warn on bad css file or image
Thanks to Alberts Muktupāvels for this code
1 parent 2170446 commit 38dbd34

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

mate-panel/main.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ static const GOptionEntry options[] = {
5555
{ NULL }
5656
};
5757

58+
static void
59+
parsing_error_cb (GtkCssProvider *provider,
60+
GtkCssSection *section,
61+
GError *error,
62+
gpointer user_data)
63+
{
64+
g_warning ("Can't parse mate-panel's CSS custom description: %s\n", error->message);
65+
}
66+
5867
int
5968
main (int argc, char **argv)
6069
{
@@ -178,6 +187,8 @@ main (int argc, char **argv)
178187
resource = "/org/mate/panel/theme/mate-panel.css";
179188
priority = GTK_STYLE_PROVIDER_PRIORITY_FALLBACK;
180189

190+
g_signal_connect (provider, "parsing-error", G_CALLBACK (parsing_error_cb), NULL);
191+
181192
gtk_css_provider_load_from_resource (css, resource);
182193
gtk_style_context_add_provider_for_screen (screen, provider, priority);
183194

0 commit comments

Comments
 (0)