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