From a0e635366794a3612f29bea0900bb129b537765d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 6 Apr 2019 23:08:10 +0000 Subject: [PATCH] inspector: Disable autoloaded custom css initially This is a safeguard against possible crashing css being autoloaded. --- gtk/inspector/css-editor.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gtk/inspector/css-editor.c b/gtk/inspector/css-editor.c index 630f27f36f..d8d11efa9e 100644 --- a/gtk/inspector/css-editor.c +++ b/gtk/inspector/css-editor.c @@ -119,8 +119,9 @@ set_initial_text (GtkInspectorCssEditor *ce) autosave_file = get_autosave_path (); - g_file_get_contents (autosave_file, &initial_text, &len, NULL); - if (!initial_text) + if (g_file_get_contents (autosave_file, &initial_text, &len, NULL)) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ce->priv->disable_button), TRUE); + else initial_text = g_strconcat ("/*\n", _("You can type here any CSS rule recognized by GTK."), "\n", _("You can temporarily disable this custom CSS by clicking on the “Pause” button above."), "\n\n",