--- src/skins/ui_skin.c.orig 2013-04-09 18:58:21.907452246 +0300 +++ src/skins/ui_skin.c 2013-04-09 19:37:28.424452521 +0300 @@ -872,6 +870,7 @@ skin_load_nolock(Skin * skin, const gchar * path, gboolean force) { gchar *newpath, *skin_path; + gchar *basename, *extract_path = NULL; int archive = 0; AUDDBG("Attempt to load skin \"%s\"\n", path); @@ -890,18 +889,30 @@ if (file_is_archive(path)) { AUDDBG("Attempt to load archive\n"); - if (!(skin_path = archive_decompress(path))) { + if (!(extract_path = archive_decompress(path))) { AUDDBG("Unable to extract skin archive (%s)\n", path); return FALSE; } + skin_path = g_strdup(extract_path); archive = 1; + if (!skin_check_pixmaps(skin, skin_path)) { + basename = archive_basename(path); + const gchar *name = g_strrstr(basename, "/"); + name = name == NULL ? basename : name + 1; + g_free(skin_path); + skin_path = g_strdup_printf("%s/%s", extract_path, name); + g_free(basename); + } } else { skin_path = g_strdup(path); } // Check if skin path has all necessary files. if (!skin_check_pixmaps(skin, skin_path)) { - if(archive) del_directory(skin_path); + if(archive) { + del_directory(extract_path); + g_free(extract_path); + } g_free(skin_path); AUDDBG("Skin path (%s) doesn't have all wanted pixmaps\n", skin_path); return FALSE; @@ -921,13 +932,19 @@ skin_parse_hints(skin, skin_path); if (!skin_load_pixmaps(skin, skin_path)) { - if(archive) del_directory(skin_path); + if(archive) { + del_directory(extract_path); + g_free(extract_path); + } g_free(skin_path); AUDDBG("Skin loading failed\n"); return FALSE; } - if(archive) del_directory(skin_path); + if(archive) { + del_directory(extract_path); + g_free(extract_path); + } g_free(skin_path); mainwin_set_shape ();