Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkgs/f/freedesktop.wayland-cursor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ package = {
linux = {
["1.26.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/wayland/releases/download/v1.26.0/wayland-1.26.0-mcpp3.tar.gz",
CN = "https://gitcode.com/mcpp-res/wayland/releases/download/1.26.0/wayland-1.26.0-mcpp3.tar.gz",
GLOBAL = "https://github.com/mcpplibs/wayland/releases/download/v1.26.0/wayland-1.26.0-mcpp4.tar.gz",
CN = "https://gitcode.com/mcpp-res/wayland/releases/download/1.26.0/wayland-1.26.0-mcpp4.tar.gz",
},
sha256 = "b95537b21b0df2119a84ec8b3b833a564259e52fbbe2b119c5f9dd7cbaad55a0",
sha256 = "9bce2cc00c61399a3c2fb15e730b664073694154860bc5e2b4496bcf09e55e52",
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions pkgs/f/freedesktop.wayland-egl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ package = {
linux = {
["1.26.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/wayland/releases/download/v1.26.0/wayland-1.26.0-mcpp3.tar.gz",
CN = "https://gitcode.com/mcpp-res/wayland/releases/download/1.26.0/wayland-1.26.0-mcpp3.tar.gz",
GLOBAL = "https://github.com/mcpplibs/wayland/releases/download/v1.26.0/wayland-1.26.0-mcpp4.tar.gz",
CN = "https://gitcode.com/mcpp-res/wayland/releases/download/1.26.0/wayland-1.26.0-mcpp4.tar.gz",
},
sha256 = "b95537b21b0df2119a84ec8b3b833a564259e52fbbe2b119c5f9dd7cbaad55a0",
sha256 = "9bce2cc00c61399a3c2fb15e730b664073694154860bc5e2b4496bcf09e55e52",
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions pkgs/f/freedesktop.wayland-scanner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ package = {
linux = {
["1.26.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/wayland/releases/download/v1.26.0/wayland-1.26.0-mcpp3.tar.gz",
CN = "https://gitcode.com/mcpp-res/wayland/releases/download/1.26.0/wayland-1.26.0-mcpp3.tar.gz",
GLOBAL = "https://github.com/mcpplibs/wayland/releases/download/v1.26.0/wayland-1.26.0-mcpp4.tar.gz",
CN = "https://gitcode.com/mcpp-res/wayland/releases/download/1.26.0/wayland-1.26.0-mcpp4.tar.gz",
},
sha256 = "b95537b21b0df2119a84ec8b3b833a564259e52fbbe2b119c5f9dd7cbaad55a0",
sha256 = "9bce2cc00c61399a3c2fb15e730b664073694154860bc5e2b4496bcf09e55e52",
},
},
},
Expand Down
21 changes: 18 additions & 3 deletions pkgs/f/freedesktop.wayland-server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@
-- `libwayland-server.so.0` are distinct SONAMEs that Mesa's libEGL_mesa needs
-- BOTH of, and mcpp links every library target in a package against all of its
-- sources — so one package cannot emit two libraries with disjoint contents.
--
-- ─────────────────────────────────────────────────────────────────────────
-- ⭐ wl_signal_* 在 mcpp4 之前够不着(已修复)
--
-- `wayland-server-core.h` 把 wl_signal_init / _add / _get / _emit 定义成
-- `static inline` —— 内部链接,C++ 禁止从模块导出。于是走**模块路线**的消费者
-- 一个都拿不到。
--
-- 这不是边角:每一次 wlroots 监听注册都是
-- `wl_signal_add(&thing->events.x, &listener)`,所以**用模块写不了合成器**。
--
-- ⚠️ 一直没发现,是因为这个包的测试从没调用过其中任何一个。缺口是从**外面**
-- 被问出来的 —— 一个最小 wlroots 合成器编不过。同一类问题在
-- `freedesktop.cairo`(少 cairo_t)和 `displayinfo`(少 295 个枚举量)上都出现
-- 过,发现方式也一样:**自己的测试问不出来,别的包在真实用途里能。**
package = {
spec = "1",
namespace = "freedesktop",
Expand All @@ -33,10 +48,10 @@ package = {
linux = {
["1.26.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/wayland/releases/download/v1.26.0/wayland-1.26.0-mcpp3.tar.gz",
CN = "https://gitcode.com/mcpp-res/wayland/releases/download/1.26.0/wayland-1.26.0-mcpp3.tar.gz",
GLOBAL = "https://github.com/mcpplibs/wayland/releases/download/v1.26.0/wayland-1.26.0-mcpp4.tar.gz",
CN = "https://gitcode.com/mcpp-res/wayland/releases/download/1.26.0/wayland-1.26.0-mcpp4.tar.gz",
},
sha256 = "b95537b21b0df2119a84ec8b3b833a564259e52fbbe2b119c5f9dd7cbaad55a0",
sha256 = "9bce2cc00c61399a3c2fb15e730b664073694154860bc5e2b4496bcf09e55e52",
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions pkgs/f/freedesktop.wayland-util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ package = {
linux = {
["1.26.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/wayland/releases/download/v1.26.0/wayland-1.26.0-mcpp3.tar.gz",
CN = "https://gitcode.com/mcpp-res/wayland/releases/download/1.26.0/wayland-1.26.0-mcpp3.tar.gz",
GLOBAL = "https://github.com/mcpplibs/wayland/releases/download/v1.26.0/wayland-1.26.0-mcpp4.tar.gz",
CN = "https://gitcode.com/mcpp-res/wayland/releases/download/1.26.0/wayland-1.26.0-mcpp4.tar.gz",
},
sha256 = "b95537b21b0df2119a84ec8b3b833a564259e52fbbe2b119c5f9dd7cbaad55a0",
sha256 = "9bce2cc00c61399a3c2fb15e730b664073694154860bc5e2b4496bcf09e55e52",
},
},
},
Expand Down
18 changes: 15 additions & 3 deletions pkgs/f/freedesktop.wayland.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@
-- `libwayland-server.so.0` are distinct SONAMEs that Mesa's libEGL_mesa needs
-- BOTH of, and mcpp links every library target in a package against all of its
-- sources — so one package cannot emit two libraries with disjoint contents.
--
-- ─────────────────────────────────────────────────────────────────────────
-- ⭐ wl_fixed_* 在 mcpp4 之前够不着(已修复)
--
-- `wayland-util.h` 把四个定点数转换定义成 `static inline`(内部链接),模块
-- 无法导出。而 `wl_fixed_t` 是协议里**每一个亚像素坐标**的载体 —— wl_pointer
-- 的移动、触摸点、数位板轴 —— 所以走模块路线的客户端**处理不了输入事件**。
--
-- ⚠️ 它们放在**这个**模块而不是 `freedesktop.wayland.util`:那个模块是和头文件
-- **配对**设计的(只出宏和模板,零个 `using ::`),加同名实体会让每次调用在
-- clang 上 `ambiguous`。也没有同时放进 server —— 两个模块各自的实体,对同时
-- import 两者的 TU 一样是二义。三个模块同时 import 已在两条工具链上实测。
package = {
spec = "1",
namespace = "freedesktop",
Expand All @@ -33,10 +45,10 @@ package = {
linux = {
["1.26.0"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/wayland/releases/download/v1.26.0/wayland-1.26.0-mcpp3.tar.gz",
CN = "https://gitcode.com/mcpp-res/wayland/releases/download/1.26.0/wayland-1.26.0-mcpp3.tar.gz",
GLOBAL = "https://github.com/mcpplibs/wayland/releases/download/v1.26.0/wayland-1.26.0-mcpp4.tar.gz",
CN = "https://gitcode.com/mcpp-res/wayland/releases/download/1.26.0/wayland-1.26.0-mcpp4.tar.gz",
},
sha256 = "b95537b21b0df2119a84ec8b3b833a564259e52fbbe2b119c5f9dd7cbaad55a0",
sha256 = "9bce2cc00c61399a3c2fb15e730b664073694154860bc5e2b4496bcf09e55e52",
},
},
},
Expand Down
20 changes: 20 additions & 0 deletions tests/examples/wayland/tests/modules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,26 @@ int main()
"WL_MARSHAL_FLAG_DESTROY keeps upstream's value");
}

// ⭐ 这八个函数在 mcpp4 之前根本够不着(`static inline` 无法从模块导出),
// 而**没有任何测试调用过它们**,所以谁都没发现。缺口是从外面被一个最小
// wlroots 合成器问出来的。下面每一行都是"再塌陷就编译不过"的探针。
{
// wayland-util.h 的定点数 —— 协议里每个亚像素坐标的载体
check(wl_fixed_from_int(3) == 768, "wl_fixed_from_int");
check(wl_fixed_to_double(wl_fixed_from_double(1.5)) == 1.5, "wl_fixed double 往返");
check(wl_fixed_from_double(-1.5) == -384, "负数按上游 round() 舍入");

// wayland-server-core.h 的 signal —— 每次 wlroots 挂监听都要它
wl_signal sig{};
wl_signal_init(&sig);
check(sig.listener_list.next == &sig.listener_list, "wl_signal_init");
wl_listener l{};
l.notify = [](wl_listener *, void *) {};
wl_signal_add(&sig, &l);
check(wl_signal_get(&sig, l.notify) == &l, "wl_signal_add + wl_signal_get");
wl_list_remove(&l.link);
}

std::printf("\n%d check(s) failed\n", failures);
return failures == 0 ? 0 : 1;
}
Expand Down
Loading