It should be noted that Xlib has been a compatibility wrapper around XCB – the "modern" X11 client library replacement – for about 15 years now, so it might make more sense to just target that.
(The only thing on the top of my head that absolutely requires Xlib is some niche Vulkan stuff; e.g. VK_EXT_acquire_xlib_display unfortunately has no XCB analogue.)
(The only thing on the top of my head that absolutely requires Xlib is some niche Vulkan stuff; e.g. VK_EXT_acquire_xlib_display unfortunately has no XCB analogue.)