logo

badwolf

minimalist and privacy-oriented web browser based on WebKitGTK git clone https://hacktivis.me/git/badwolf.git
commit: ceda775b16b7758d74eef0870c058ca0ee541ed8
parent 94c50148edca27ef02c4af86e9be60127fef3539
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 @@ -924,10 +924,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)), @@ -936,11 +936,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)),