From c6208a98c80f4b945608b4ce1bd6f35fab5b56d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 13 Sep 2024 08:45:54 +0200 Subject: [PATCH] main: include toplevel-icon support in --version output --- foot-features.h | 9 +++++++++ main.c | 3 ++- wayland.c | 20 +++++++++++++------- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/foot-features.h b/foot-features.h index ad447767..674c1056 100644 --- a/foot-features.h +++ b/foot-features.h @@ -37,3 +37,12 @@ static inline bool feature_graphemes(void) return false; #endif } + +static inline bool feature_xdg_toplevel_icon(void) +{ +#if defined(HAVE_XDG_TOPLEVEL_ICON) + return true; +#else + return false; +#endif +} diff --git a/main.c b/main.c index 15741012..973cbae4 100644 --- a/main.c +++ b/main.c @@ -51,11 +51,12 @@ 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 %cassertions", FOOT_VERSION, feature_pgo() ? '+' : '-', feature_ime() ? '+' : '-', feature_graphemes() ? '+' : '-', + feature_xdg_toplevel_icon() ? '+' : '-', feature_assertions() ? '+' : '-'); return buf; } diff --git a/wayland.c b/wayland.c index fd228312..9c184adc 100644 --- a/wayland.c +++ b/wayland.c @@ -1592,27 +1592,33 @@ wayl_init(struct fdm *fdm, struct key_binding_manager *key_binding_manager, goto out; } + if (presentation_timings && wayl->presentation == NULL) { + LOG_ERR("compositor does not implement the presentation time interface"); + goto out; + } + if (wayl->primary_selection_device_manager == NULL) - LOG_WARN("no primary selection available"); + LOG_WARN("compositor does not implement the primary selection interface"); if (wayl->xdg_activation == NULL) { LOG_WARN( - "no XDG activation support; " + "compositor does not implement XDG activation, " "bell.urgent will fall back to coloring the window margins red"); } if (wayl->fractional_scale_manager == NULL || wayl->viewporter == NULL) - LOG_WARN("fractional scaling not available"); + LOG_WARN("compositor does not implement fractional scaling"); if (wayl->cursor_shape_manager == NULL) { - LOG_WARN("no server-side cursors available, " + LOG_WARN("compositor does not implement server-side cursors, " "falling back to client-side cursors"); } - if (presentation_timings && wayl->presentation == NULL) { - LOG_ERR("presentation time interface not implemented by compositor"); - goto out; +#if defined(HAVE_XDG_TOPLEVEL_ICON) + if (wayl->toplevel_icon_manager == NULL) { + LOG_WARN("compositor does not implement the XDG toplevel icon protocol"); } +#endif #if defined(FOOT_IME_ENABLED) && FOOT_IME_ENABLED if (wayl->text_input_manager == NULL) {