Closed LaterBird closed 9 months ago
wayland 1.21.0 source code:
implementation = target->implementation;
if (!implementation[opcode]) {
wl_abort("listener function for opcode %u of %s is NULL\n",
opcode, target->interface->name);
} else {
ffi_call(&cif, implementation[opcode], NULL, ffi_args);
}
target->implementation is 'xdg_toplevel_listener' xdg_toplevel_add_listener(window->xdg_toplevel, &xdg_toplevel_listener, window);
static inline int
xdg_toplevel_add_listener(struct xdg_toplevel *xdg_toplevel,
const struct xdg_toplevel_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) xdg_toplevel,
(void (**)(void)) listener, data);
}
in wayland source code wl_proxy_add_listener is:
WL_EXPORT int
wl_proxy_add_listener(struct wl_proxy *proxy,
void (**implementation)(void), void *data)
{
if (proxy->flags & WL_PROXY_FLAG_WRAPPER)
wl_abort("Proxy %p is a wrapper\n", proxy);
if (proxy->object.implementation || proxy->dispatcher) {
wl_log("proxy %p already has listener\n", proxy);
return -1;
}
proxy->object.implementation = implementation; // Note here, so xdg_toplevel_listener.wm_capabilities Should be assigned a function
proxy->user_data = data;
return 0;
}
lvgl version: 8.3.10 lv_drivers: release-v8.3 wayland: 1.21.0 weston: 11.0.1
same issue #222