linux: require wayland-client so frameless chrome can't be dropped (T-349)

The frameless custom chrome (D-057) is gated on HAS_WAYLAND_CLIENT, which
was only defined when CMake's non-required wayland-client check happened
to find it. A build host/container without the Wayland client dev headers
(plausible on Bazzite/immutable distros that build in a distrobox) silently
compiled the decoration-suppression out, so the rebuilt app shipped the
compositor's native title bar (double title bar on KDE Plasma Wayland).

Make wayland-client a hard requirement: fail the configure with an
actionable message (Fedora wayland-devel / Debian libwayland-dev) rather
than drop a core feature. Fix the stale "xdg-decoration" comment — the
code uses the KDE server-decoration protocol.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-10 19:46:25 +02:00
co-authored by Claude Opus 4.8
parent b7e0835b74
commit 16dc628fee
3 changed files with 20 additions and 5 deletions
+14 -5
View File
@@ -13,15 +13,24 @@ apply_standard_settings(${BINARY_NAME})
add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")
# Find wayland-client for xdg-decoration protocol (D-057).
# Frameless custom chrome (D-057) drives the Wayland server-decoration protocol,
# which needs wayland-client at build time. It is a HARD requirement on a Linux
# desktop build host: without it the decoration-suppression path is compiled out
# and the app silently ships the compositor's native title bar — the exact thing
# D-057 removes (double title bar on KDE Plasma Wayland). Fail the configure
# loudly rather than drop a core feature (T-349).
pkg_check_modules(WAYLAND_CLIENT IMPORTED_TARGET wayland-client)
if(NOT WAYLAND_CLIENT_FOUND)
message(FATAL_ERROR
"wayland-client (Wayland client dev headers) not found, but clide's "
"frameless window chrome (D-057) requires it. Install it — Fedora: "
"wayland-devel, Debian/Ubuntu: libwayland-dev — and rebuild.")
endif()
target_link_libraries(${BINARY_NAME} PRIVATE flutter)
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)
if(WAYLAND_CLIENT_FOUND)
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::WAYLAND_CLIENT)
target_compile_definitions(${BINARY_NAME} PRIVATE HAS_WAYLAND_CLIENT=1)
endif()
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::WAYLAND_CLIENT)
target_compile_definitions(${BINARY_NAME} PRIVATE HAS_WAYLAND_CLIENT=1)
target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}/runner")