freedesktop.wayland-cursor
#includelibwayland-cursor 1.26.0 — load an XCursor theme into a wl_buffer, for clients that set their own pointer
#include <wayland-cursor.h>
mcpp add freedesktop.wayland-cursor@1.26.0
用法
来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。
// freedesktop.wayland-cursor — the client-side pointer.
//
// WHAT CANNOT BE ASSERTED HERE, AND WHY THE FIRST VERSION OF THIS FILE CRASHED
//
// `wl_cursor_theme_load(name, size, shm)` is not callable without a compositor,
// and not merely inadvisable: line 410 of upstream's wayland-cursor.c is
//
// theme->pool = shm_pool_create(shm, size * size * 4);
//
// which reaches `wl_shm_create_pool(shm, ...)` and dereferences the proxy with
// no null check. The first version of this test passed `nullptr` on the theory
// that only the theme PARSER would run — it segfaulted (exit 139). A `wl_shm`
// comes from a compositor's registry, so the buffer half of this library
// belongs in a program that has one, exactly as opening /dev/input/event*
// belongs outside tests/examples/libinput.
//
// WHAT IS ASSERTED IS STILL THE PART THAT CARRIES THE PACKAGING RISK: that the
// hand-written module wrapper exports every name, that the two PUBLIC structs
// are usable as values rather than opaque handles, and that libwayland-client
// is really linked in. The compiled-in cursor search path being empty — the
// other packaging decision — is checked in the fork's CI by grepping the
// binary, which is the only place it is visible.
// …
tests/examples/wayland-cursor/tests/wayland-cursor.cpp · 项目 tests/examples/wayland-cursor
构建
A 型包:上游压缩包自带 mcpp.toml(在 */mcpp/cursor/mcpp.toml)。本次构建没有抓取它的内容 —— 跑一次索引的刷新动作就能拉进来。