mirror of
https://github.com/swaywm/sway.git
synced 2026-06-14 14:33:19 -04:00
swaybar/tray: replace icon lookup with libsfdo
Drops the in-tree icon theme parser and lookup logic in favor of libsfdo-icon, which implements the icon theme spec. Absolute icon paths are handled in swaybar itself with an access() probe, since libsfdo intentionally doesn't deal with them. Pixmap fallback still kicks in if load_image() fails on the absolute path. KDE's IconThemePath is honored via sfdo_icon_theme_load_from() with a per-SNI override theme that gets dropped when the property changes. The min/max size cache per SNI is replaced by re-lookup when the rendered size changes; libsfdo caches the parsed theme internally and reads gtk's icon-theme.cache files, so this is cheap. Theme switching at runtime is preserved via a new tray_reload_icon_theme() called from parse_bar_config(). The old code worked here implicitly because all themes were preloaded. Closes: https://github.com/swaywm/sway/issues/8607
This commit is contained in:
parent
c857ca3a97
commit
81c31b0c4d
11 changed files with 175 additions and 597 deletions
|
|
@ -97,9 +97,12 @@ else
|
|||
sdbus = dependency(get_option('sd-bus-provider'), required: get_option('tray'))
|
||||
endif
|
||||
|
||||
tray_deps_found = sdbus.found()
|
||||
sfdo_icon = dependency('libsfdo-icon', version: '>=0.1.3', required: get_option('tray'))
|
||||
sfdo_basedir = dependency('libsfdo-basedir', version: '>=0.1.3', required: get_option('tray'))
|
||||
|
||||
tray_deps_found = sdbus.found() and sfdo_icon.found() and sfdo_basedir.found()
|
||||
if get_option('tray').enabled() and not tray_deps_found
|
||||
error('Building with -Dtray=enabled, but sd-bus has not been not found')
|
||||
error('Building with -Dtray=enabled, but sd-bus or libsfdo has not been found')
|
||||
endif
|
||||
have_tray = (not get_option('tray').disabled()) and tray_deps_found
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue