Closed rbuj closed 5 years ago
why not with little changes like I mentioned in https://github.com/mate-desktop/mate-screensaver/pull/203#issuecomment-520187193 ?
patch over master:
diff --git a/src/gs-lock-plug.c b/src/gs-lock-plug.c
index c3081c2..243eaaa 100644
--- a/src/gs-lock-plug.c
+++ b/src/gs-lock-plug.c
@@ -2011,7 +2011,12 @@ load_theme (GSLockPlug *plug)
static GtkCssProvider *style_provider = NULL;
if (style_provider == NULL)
+ {
style_provider = gtk_css_provider_new ();
+ gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
+ GTK_STYLE_PROVIDER (style_provider),
+ GTK_STYLE_PROVIDER_PRIORITY_USER);
+ }
gtk_css_provider_load_from_path (style_provider, css, NULL);
}
this reduces the scope of the static variable
@sc0w
I think that style_provider should be created even if lock-dialog-THEME.css doesn't exist, since the user can define the css info in XDG_CONFIG_HOME.
$ LANG=C ls /usr/share/mate-screensaver/lock-dialog-default.css
ls: cannot access '/usr/share/mate-screensaver/lock-dialog-default.css': No such file or directory
Test: gtk-theme TraditionalOk + lock-dialog-theme default + ~/.config/gtk-3.0/gtk.css
mkdir -p ~/.config/gtk-3.0
wget -q -O ~/.config/gtk-3.0/gtk.css https://gist.githubusercontent.com/geki-yaba/19262f9af9b2a6f838636e6f019e96a3/raw/24a5ee22a0338c6c145db15f363bcbe73c64630d/gistfile1.txt
gsettings set org.mate.screensaver lock-dialog-theme default
gsettings set org.mate.interface gtk-theme TraditionalOk
mate-screensaver-command -l
@sc0w
I'm sorry, you're right. Your proposal also works with the last test.
https://developer.gnome.org/gtk3/stable/GtkStyleContext.html#gtk-style-context-add-provider-for-screen
css data is located at /usr/share/mate-screensaver/lock-dialog-THEME.css, XDG_CONFIG_HOME/gtk-3.0/gtk.css, /usr/share/themes/...
/usr/share/mate-screensaver/lock-dialog-THEME.css file has highest priority, if exists:
Otherwise:
Examples:
Face image: https://en.wikipedia.org/wiki/File:User_icon_2.svg From Tango Desktop Project