diff --git a/src/wl_init.c b/src/wl_init.c index c4e47e99..c232ce79 100644 --- a/src/wl_init.c +++ b/src/wl_init.c @@ -47,13 +47,38 @@ #include "wayland-pointer-constraints-unstable-v1-client-protocol.h" #include "wayland-idle-inhibit-unstable-v1-client-protocol.h" +// NOTE: Versions of wayland-scanner prior to 1.17.91 named every global array of +// wl_interface pointers 'types', making it impossible to combine several unmodified +// private-code files into a single compilation unit +// HACK: We override this name with a macro for each file, allowing them to coexist + +#define types _glfw_wayland_types #include "wayland-client-protocol-code.h" +#undef types + +#define types _glfw_xdg_shell_types #include "wayland-xdg-shell-client-protocol-code.h" +#undef types + +#define types _glfw_xdg_decoration_types #include "wayland-xdg-decoration-client-protocol-code.h" +#undef types + +#define types _glfw_viewporter_types #include "wayland-viewporter-client-protocol-code.h" +#undef types + +#define types _glfw_relative_pointer_types #include "wayland-relative-pointer-unstable-v1-client-protocol-code.h" +#undef types + +#define types _glfw_pointer_constraints_types #include "wayland-pointer-constraints-unstable-v1-client-protocol-code.h" +#undef types + +#define types _glfw_idle_inhibit_types #include "wayland-idle-inhibit-unstable-v1-client-protocol-code.h" +#undef types static void wmBaseHandlePing(void* userData, struct xdg_wm_base* wmBase,