gate-kx11extras: also guard fixx11h.h and netwm.h

KWindowSystem ships fixx11h.h (X11 macro cleanup), netwm.h and netwm_def.h
(EWMH) only with its X11 component, so a Wayland-only install lacks them. They
carry no X11/ or xcb/ path prefix, so the prefix-only rule missed them:
  logout-greeter/shutdowndlg.cpp:51: fatal error: fixx11h.h: No such file

The single remaining unguarded case is libtaskmanager/xwindowtasksmodel.cpp,
which upstream excludes from the build via if(HAVE_X11) in
libtaskmanager/CMakeLists.txt -- it is never compiled, so it is left alone
rather than edited for appearance.
This commit is contained in:
2026-08-04 22:16:38 +03:00
parent 270d0c9ff6
commit ab7cc543b8
+9 -2
View File
@@ -370,7 +370,12 @@ def gate_raw_x11_includes(text: str) -> tuple[str, int]:
r"""Guard bare `#include <X11/...>` / `<xcb/...>` that sit outside HAVE_X11.
Distinct from the KWindowSystem-API gating above: these are the Xlib/XCB
headers themselves. A Wayland-only sysroot ships none of them, so each is a
headers themselves, plus the X11-only KDE headers that KWindowSystem ships
only with its X11 component -- fixx11h.h (X11 macro cleanup), netwm.h and
netwm_def.h (EWMH). Those carry no X11/ or xcb/ path prefix, so a
prefix-only rule missed them:
logout-greeter/shutdowndlg.cpp:51: fatal error: fixx11h.h: No such file
A Wayland-only sysroot ships none of them, so each is a
hard compile failure:
appmenu/appmenu.h:13: fatal error: xcb/xcb.h: No such file or directory
@@ -406,7 +411,9 @@ def gate_raw_x11_includes(text: str) -> tuple[str, int]:
inx -= 1
out.append(line)
continue
if inx == 0 and re.match(r"#\s*include\s*<(X11/|xcb/)", st):
if inx == 0 and re.match(
r"#\s*include\s*<(X11/|xcb/|fixx11h\.h|netwm\.h|netwm_def\.h)", st
):
ind = re.match(r"[ \t]*", line).group(0)
out.append(f"{ind}{GUARD_OPEN}")
out.append(line)