two years passed, i finally learned how to use wl_signal  ╥﹏╥...
https://codeberg.org/qaqland/wayland-util-demo/src/branch/main/wl_signal.c