summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin Glidic <sardemff7+git@sardemff7.net>2017-10-20 22:53:15 +0200
committerQuentin Glidic <sardemff7+git@sardemff7.net>2017-10-20 22:53:17 +0200
commitaf81a54adf040b2cb1bc52c0f480205310f8fec2 (patch)
treefd5479c940d014b7c51e8c8a0c1a50ebb1de6551
parent5f1be779a2c30bd2a02ea8c501dbf9d187326bd4 (diff)
drun: Load absolute path icons properly
This was lost in the rework commit 4d8784cf85a5108340a2b2a684e2bd1d9f77269d and never added back. Fixes #701 Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
-rw-r--r--source/dialogs/drun.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/source/dialogs/drun.c b/source/dialogs/drun.c
index b9129f17..33ce69f8 100644
--- a/source/dialogs/drun.c
+++ b/source/dialogs/drun.c
@@ -516,13 +516,20 @@ static void drun_icon_fetch ( gpointer data, gpointer user_data )
if ( dr->icon_name == NULL ) {
return;
}
- gchar *icon_path = nk_xdg_theme_get_icon ( pd->xdg_context, themes, NULL, dr->icon_name, dr->icon_size, 1, TRUE );
- if ( icon_path == NULL ) {
- g_debug ( "Failed to get Icon %s(%d): n/a", dr->icon_name, dr->icon_size );
- return;
- }
- else{
- g_debug ( "Found Icon %s(%d): %s", dr->icon_name, dr->icon_size, icon_path );
+ const gchar *icon_path;
+ gchar *icon_path_ = NULL;
+
+ if ( g_path_is_absolute ( dr->icon_name ) )
+ icon_path = dr->icon_name;
+ else {
+ icon_path = icon_path_ = nk_xdg_theme_get_icon ( pd->xdg_context, themes, NULL, dr->icon_name, dr->icon_size, 1, TRUE );
+ if ( icon_path_ == NULL ) {
+ g_debug ( "Failed to get Icon %s(%d): n/a", dr->icon_name, dr->icon_size );
+ return;
+ }
+ else{
+ g_debug ( "Found Icon %s(%d): %s", dr->icon_name, dr->icon_size, icon_path );
+ }
}
cairo_surface_t *icon_surf = NULL;
if ( g_str_has_suffix ( icon_path, ".png" ) ) {
@@ -543,7 +550,7 @@ static void drun_icon_fetch ( gpointer data, gpointer user_data )
}
dr->icon = icon_surf;
}
- g_free ( icon_path );
+ g_free ( icon_path_ );
rofi_view_reload ();
}