1Subject: [PATCHv2] gtk: Patch GTK+ to look for themes in profiles.
2To: guix-devel@gnu.org
3Date: Sun, 13 Mar 2016 15:17:37 +1100
4Url: https://lists.gnu.org/archive/html/guix-devel/2016-03/msg00492.html
5
6diff -Naur gtk+-2.24.28.new/gtk/gtkrc.c gtk+-2.24.28/gtk/gtkrc.c
7--- gtk+-2.24.28.new/gtk/gtkrc.c 2016-03-13 10:31:14.413644362 +1100
8+++ gtk+-2.24.28/gtk/gtkrc.c 2016-03-13 12:51:34.723398423 +1100
9@@ -808,6 +808,8 @@
10 gchar *path = NULL;
11 const gchar *home_dir;
12 gchar *subpath;
13+ const gchar * const *xdg_data_dirs;
14+ gint i;
15
16 if (type)
17 subpath = g_strconcat ("gtk-2.0-", type,
18@@ -830,6 +832,22 @@
19 }
20
21 if (!path)
22+ {
23+ xdg_data_dirs = g_get_system_data_dirs ();
24+ for (i = 0; xdg_data_dirs[i]; i++)
25+ {
26+ path = g_build_filename (xdg_data_dirs[i], "themes", name, subpath, NULL);
27+ if (g_file_test (path, G_FILE_TEST_EXISTS))
28+ break;
29+ else
30+ {
31+ g_free (path);
32+ path = NULL;
33+ }
34+ }
35+ }
36+
37+ if (!path)
38 {
39 gchar *theme_dir = gtk_rc_get_theme_dir ();
40 path = g_build_filename (theme_dir, name, subpath, NULL);