mirror of
https://github.com/davatorium/rofi.git
synced 2025-07-31 21:59:25 -04:00
drun: Load absolute path icons properly
This was lost in the rework commit
4d8784cf85
and never added back.
Fixes #701
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
This commit is contained in:
parent
5f1be779a2
commit
af81a54adf
1 changed files with 15 additions and 8 deletions
|
@ -516,13 +516,20 @@ static void drun_icon_fetch ( gpointer data, gpointer user_data )
|
||||||
if ( dr->icon_name == NULL ) {
|
if ( dr->icon_name == NULL ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
gchar *icon_path = nk_xdg_theme_get_icon ( pd->xdg_context, themes, NULL, dr->icon_name, dr->icon_size, 1, TRUE );
|
const gchar *icon_path;
|
||||||
if ( icon_path == NULL ) {
|
gchar *icon_path_ = NULL;
|
||||||
g_debug ( "Failed to get Icon %s(%d): n/a", dr->icon_name, dr->icon_size );
|
|
||||||
return;
|
if ( g_path_is_absolute ( dr->icon_name ) )
|
||||||
}
|
icon_path = dr->icon_name;
|
||||||
else{
|
else {
|
||||||
g_debug ( "Found Icon %s(%d): %s", dr->icon_name, dr->icon_size, icon_path );
|
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;
|
cairo_surface_t *icon_surf = NULL;
|
||||||
if ( g_str_has_suffix ( icon_path, ".png" ) ) {
|
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;
|
dr->icon = icon_surf;
|
||||||
}
|
}
|
||||||
g_free ( icon_path );
|
g_free ( icon_path_ );
|
||||||
rofi_view_reload ();
|
rofi_view_reload ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue