ssd: support window icons

The default `titleLayout` is updated to `icon:iconify,max,close` which
replaces the window menu button with the window icon.

When the icon file is not found or could not be loaded, the window menu
icon as before is shown.

The icon theme can be selected with `<theme><icon>`.

This commit adds libsfdo as an optional dependency. `-Dicon=disabled` can
be passsed to `meson setup` command in order to disable window icon, in
which case the window icon is always replaced with a window menu button.
This commit is contained in:
tokyo4j 2024-09-06 17:00:40 +09:00 committed by Hiroaki Yamamoto
parent b9414d8b8d
commit a745f91169
32 changed files with 452 additions and 142 deletions

View file

@ -73,6 +73,24 @@ pixman = dependency('pixman-1')
math = cc.find_library('m')
png = dependency('libpng')
svg = dependency('librsvg-2.0', version: '>=2.46', required: false)
sfdo_basedir = dependency(
'libsfdo-basedir',
default_options: ['default_library=static', 'examples=false', 'tests=false'],
version: '>=0.1.0',
required: not get_option('icon').disabled(),
)
sfdo_desktop = dependency(
'libsfdo-desktop',
default_options: ['default_library=static', 'examples=false', 'tests=false'],
version: '>=0.1.0',
required: not get_option('icon').disabled(),
)
sfdo_icon = dependency(
'libsfdo-icon',
default_options: ['default_library=static', 'examples=false', 'tests=false'],
version: '>=0.1.0',
required: not get_option('icon').disabled(),
)
if get_option('xwayland').enabled() and not wlroots_has_xwayland
error('no wlroots Xwayland support')
@ -88,6 +106,9 @@ else
endif
conf_data.set10('HAVE_RSVG', have_rsvg)
have_libsfdo = sfdo_basedir.found() and sfdo_desktop.found() and sfdo_icon.found()
conf_data.set10('HAVE_LIBSFDO', have_libsfdo)
if get_option('static_analyzer').enabled()
add_project_arguments(['-fanalyzer'], language: 'c')
endif
@ -126,6 +147,13 @@ if have_rsvg
svg,
]
endif
if have_libsfdo
labwc_deps += [
sfdo_basedir,
sfdo_desktop,
sfdo_icon,
]
endif
subdir('include')
subdir('src')