desktop-entry: separate icon and app_id icon lookup

This patch splits desktop_entry_icon_lookup() into two separate functions
- desktop_entry_load_icon(): load a icon from the configured icon theme
- desktop_entry_load_icon_from_app_id(): load a icon name from a .desktop
  file based on the given app_id and supply it to _load_icon().

The _load_icon() function will be used in a future menu icon
implementation whereas the _load_icon_from_app_id() function is used
within the SSD titlebar window icon lookup routine.
This commit is contained in:
Consolatis 2025-01-07 15:21:30 +01:00 committed by Hiroaki Yamamoto
parent d53cf642f5
commit 4ecedcdb3b
3 changed files with 51 additions and 35 deletions

View file

@ -609,7 +609,7 @@ ssd_update_window_icon(struct ssd *ssd)
*/
float icon_scale = output_max_scale(ssd->view->server);
struct lab_img *icon_img = desktop_entry_icon_lookup(
struct lab_img *icon_img = desktop_entry_load_icon_from_app_id(
ssd->view->server, app_id, icon_size, icon_scale);
if (!icon_img) {
wlr_log(WLR_DEBUG, "icon could not be loaded for %s", app_id);