[Theme] Try to fix importing of theme.

- Fix the two place of resolving into one method.
- Do not accept file in CWD.
- Prefer file if it exists in same directory as parent file that
  imported it.

fixes: #1889
This commit is contained in:
Dave Davenport
2023-08-15 19:12:14 +02:00
parent 528419269e
commit ad06fb9516
10 changed files with 56 additions and 32 deletions

View File

@@ -92,7 +92,8 @@ gboolean config_parse_set_property(G_GNUC_UNUSED const Property *p,
}
char *rofi_expand_path(G_GNUC_UNUSED const char *path) { return NULL; }
char *helper_get_theme_path(const char *file, G_GNUC_UNUSED const char **ext) {
char *helper_get_theme_path(const char *file, G_GNUC_UNUSED const char **ext,
G_GNUC_UNUSED const char *parent_file) {
return g_strdup(file);
}
void rofi_add_error_message(G_GNUC_UNUSED GString *msg) {}

View File

@@ -77,7 +77,8 @@ cairo_surface_t *rofi_icon_fetcher_get(G_GNUC_UNUSED const uint32_t uid) {
int monitor_active(G_GNUC_UNUSED workarea *mon) { return 0; }
char *helper_get_theme_path(const char *file, G_GNUC_UNUSED const char **ext) {
char *helper_get_theme_path(const char *file, G_GNUC_UNUSED const char **ext,
G_GNUC_UNUSED const char *parent_file) {
return g_strdup(file);
}
gboolean config_parse_set_property(G_GNUC_UNUSED const Property *p,