logo

badwolf

Minimalist and privacy-oriented WebKitGTK+ browser
commit: b6e995810f9cba4dac83d57643a5f9698699cbad
parent: 7e427d599e74d8b1b89afafdaa7628a3e8483afb
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sat, 22 Aug 2020 08:35:48 +0200

badwolf.c: Only create CSS Providers when needed

Diffstat:

Mbadwolf.c6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/badwolf.c b/badwolf.c @@ -940,10 +940,10 @@ main(int argc, char *argv[]) gtk_window_set_role(GTK_WINDOW(window->main_window), "browser"); gtk_window_set_icon_name(GTK_WINDOW(window->main_window), "badwolf"); - GtkCssProvider *css_provider_app = gtk_css_provider_new(); - gchar *provider_path_app = g_build_filename(DATADIR, "interface.css", NULL); + gchar *provider_path_app = g_build_filename(DATADIR, "interface.css", NULL); if(access(provider_path_app, R_OK) == 0) { + GtkCssProvider *css_provider_app = gtk_css_provider_new(); gtk_css_provider_load_from_path(css_provider_app, provider_path_app, NULL); gtk_style_context_add_provider_for_screen( gtk_widget_get_screen(GTK_WIDGET(window->main_window)), @@ -952,11 +952,11 @@ main(int argc, char *argv[]) } g_free(provider_path_app); - GtkCssProvider *css_provider_user = gtk_css_provider_new(); gchar *provider_path_user = g_build_filename(g_get_user_data_dir(), "badwolf", "interface.css", NULL); if(access(provider_path_user, R_OK) == 0) { + GtkCssProvider *css_provider_user = gtk_css_provider_new(); gtk_css_provider_load_from_path(css_provider_user, provider_path_user, NULL); gtk_style_context_add_provider_for_screen( gtk_widget_get_screen(GTK_WIDGET(window->main_window)),