From aeb28e33fa774e9d00ffbc1054c6152ebe54babd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 17 Jan 2025 11:22:23 +0100 Subject: [PATCH] features: add +/-system-bell to version output --- client.c | 6 ++++-- foot-features.h | 9 +++++++++ main.c | 3 ++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/client.c b/client.c index 8576531f..757f4d41 100644 --- a/client.c +++ b/client.c @@ -67,12 +67,14 @@ version_and_features(void) { static char buf[256]; snprintf(buf, sizeof(buf), - "version: %s %cpgo %cime %cgraphemes %cassertions", + "version: %s %cpgo %cime %cgraphemes %ctoplevel-icon %csystem-bell %cassertions", FOOT_VERSION, feature_pgo() ? '+' : '-', feature_ime() ? '+' : '-', feature_graphemes() ? '+' : '-', - feature_assertions() ? '+' : '-'); + feature_xdg_toplevel_icon() ? '+' : '-', + feature_xdg_system_bell() ? '+' : '-', + feature_assertions() ? '+' : '-'); return buf; } diff --git a/foot-features.h b/foot-features.h index 674c1056..0eef5eac 100644 --- a/foot-features.h +++ b/foot-features.h @@ -46,3 +46,12 @@ static inline bool feature_xdg_toplevel_icon(void) return false; #endif } + +static inline bool feature_xdg_system_bell(void) +{ +#if defined(HAVE_XDG_SYSTEM_BELL) + return true; +#else + return false; +#endif +} diff --git a/main.c b/main.c index 973cbae4..c5c11080 100644 --- a/main.c +++ b/main.c @@ -51,12 +51,13 @@ version_and_features(void) { static char buf[256]; snprintf(buf, sizeof(buf), - "version: %s %cpgo %cime %cgraphemes %ctoplevel-icon %cassertions", + "version: %s %cpgo %cime %cgraphemes %ctoplevel-icon %csystem-bell %cassertions", FOOT_VERSION, feature_pgo() ? '+' : '-', feature_ime() ? '+' : '-', feature_graphemes() ? '+' : '-', feature_xdg_toplevel_icon() ? '+' : '-', + feature_xdg_system_bell() ? '+' : '-', feature_assertions() ? '+' : '-'); return buf; }