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

@ -25,6 +25,9 @@
#include "config/rcxml.h"
#include "config/session.h"
#include "decorations.h"
#if HAVE_LIBSFDO
#include "icon-loader.h"
#endif
#include "idle.h"
#include "labwc.h"
#include "layers.h"
@ -56,6 +59,11 @@ reload_config_and_theme(struct server *server)
theme_finish(server->theme);
theme_init(server->theme, server, rc.theme_name);
#if HAVE_LIBSFDO
icon_loader_finish(server);
icon_loader_init(server);
#endif
struct view *view;
wl_list_for_each(view, &server->views, link) {
view_reload_ssd(view);
@ -547,6 +555,10 @@ server_init(struct server *server)
layers_init(server);
#if HAVE_LIBSFDO
icon_loader_init(server);
#endif
#if HAVE_XWAYLAND
xwayland_server_init(server, compositor);
#endif
@ -597,4 +609,8 @@ server_finish(struct server *server)
/* TODO: clean up various scene_tree nodes */
workspaces_destroy(server);
#if HAVE_LIBSFDO
icon_loader_finish(server);
#endif
}