From 51a58aacaed1e63f5bfb1c12d876587a4810ba9c Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Tue, 3 Nov 2015 05:26:52 +0100 Subject: [PATCH] swallow errors on CSS loading preliminary workaround for Ticket #972 On Debian/Jessie, we observed the following error "gtk-lumiera.css:38:19Theming engine 'adwaita' not found" even though the package gnome-themes-standard *is* installed This allows at least to bring the UI up, even if loading our custom theme and stylesheet fails. --- src/gui/window-manager.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/window-manager.cpp b/src/gui/window-manager.cpp index 20898e46d..73c295546 100644 --- a/src/gui/window-manager.cpp +++ b/src/gui/window-manager.cpp @@ -64,8 +64,16 @@ namespace gui { { auto screen = Gdk::Screen::get_default(); auto css_provider = CssProvider::create(); - css_provider->load_from_path (lib::resolveModulePath (stylesheetName, resourceSerachPath_)); + try + { + css_provider->load_from_path (lib::resolveModulePath (stylesheetName, resourceSerachPath_)); /////////////////////////////////TICKET #953 should detect and notify CSS parsing errors. CssProvider offers a signal for this purpose + /////////////////////////////////TICKET #953 ...seems to be supported properly starting with gtkmm 3.18 (Debian/Jessie has 3.14) + } + catch(Glib::Error const& failure) + { + WARN(gui, "Failure while loading stylesheet '%s': %s", cStr(stylesheetName), cStr(failure.what())); + } StyleContext::add_provider_for_screen (screen, css_provider, GTK_STYLE_PROVIDER_PRIORITY_USER);