# HG changeset patch # User William Pitcock # Date 1192498447 18000 # Node ID acb362a67c01e634b7fbdc024e7abed5c8991792 # Parent 05ed0e49cf4709283d2ce18328630712f3dcc281 all of this shit to allow for skins to provide gtk skinning too... what bullshit... diff -r 05ed0e49cf47 -r acb362a67c01 src/audacious/skin.c --- a/src/audacious/skin.c Mon Oct 15 00:01:57 2007 -0500 +++ b/src/audacious/skin.c Mon Oct 15 20:34:07 2007 -0500 @@ -1464,7 +1464,7 @@ static gboolean skin_load_nolock(Skin * skin, const gchar * path, gboolean force) { - gchar *cpath; + gchar *cpath, *gtkrcpath; g_return_val_if_fail(skin != NULL, FALSE); g_return_val_if_fail(path != NULL, FALSE); @@ -1489,6 +1489,24 @@ skin_load_cursor(skin, path); + gtkrcpath = find_file_recursively(skin->path, "gtkrc"); + + /* the way GTK does things can be very broken. --nenolod */ + if (gtkrcpath != NULL) { + GtkSettings *settings = gtk_settings_get_default(); + gchar *tmp = g_strdup_printf("%s/.themes/aud-%s", g_get_home_dir(), basename(skin->path)); + + gchar *troot = g_strdup_printf("%s/.themes"); + g_mkdir_with_parents(troot, 0755); + g_free(troot); + + symlink(skin->path, tmp); + gtk_settings_set_string_property (settings, "gtk-theme-name", basename(skin->path), "audacious"); + + unlink(tmp); + g_free(tmp); + } + return TRUE; } @@ -1497,6 +1515,8 @@ return FALSE; } + gtkrcpath = find_file_recursively(skin->path, "gtkrc"); + /* Parse the hints for this skin. */ skin_parse_hints(skin, cpath); @@ -1509,6 +1529,22 @@ skin_load_cursor(skin, cpath); + /* the way GTK does things can be very broken. --nenolod */ + if (gtkrcpath != NULL) { + GtkSettings *settings = gtk_settings_get_default(); + gchar *tmp = g_strdup_printf("%s/.themes/aud-%s", g_get_home_dir(), basename(skin->path)); + + gchar *troot = g_strdup_printf("%s/.themes"); + g_mkdir_with_parents(troot, 0755); + g_free(troot); + + symlink(skin->path, tmp); + gtk_settings_set_string_property (settings, "gtk-theme-name", basename(skin->path), "audacious"); + + unlink(tmp); + g_free(tmp); + } + del_directory(cpath); g_free(cpath);