client: use the proper new_id index in marshalling

fixes #13
This commit is contained in:
Vaxry 2024-12-21 15:05:13 +00:00
parent 90e87f7fcf
commit 4d7367b6ee

View file

@ -675,8 +675,8 @@ static const void* {}[] = {{
std::string argsN = ", "; std::string argsN = ", ";
for (auto& arg : ev.args) { for (auto& arg : ev.args) {
if (arg.newType) if (arg.newType)
continue; argsN += "nullptr, ";
if (!WPTypeToCType(arg, true).starts_with("C")) else if (!WPTypeToCType(arg, true).starts_with("C"))
argsN += arg.name + ", "; argsN += arg.name + ", ";
else else
argsN += (arg.name + " ? " + arg.name + "->pResource : nullptr, "); argsN += (arg.name + " ? " + arg.name + "->pResource : nullptr, ");
@ -703,12 +703,12 @@ void {}::{}({}) {{
if (!pResource) if (!pResource)
return{};{} return{};{}
auto proxy = wl_proxy_marshal_flags((wl_proxy*)pResource, {}, {}, wl_proxy_get_version((wl_proxy*)pResource), {}{}{});{} auto proxy = wl_proxy_marshal_flags((wl_proxy*)pResource, {}, {}, wl_proxy_get_version((wl_proxy*)pResource), {}{});{}
}} }}
)#", )#",
ptrRetType, IFACE_CLASS_NAME_CAMEL, EVENT_NAME, argsC, (ev.newIdType.empty() ? "" : " nullptr"), ptrRetType, IFACE_CLASS_NAME_CAMEL, EVENT_NAME, argsC, (ev.newIdType.empty() ? "" : " nullptr"),
(ev.destructor ? "\n destroyed = true;" : ""), evid, (ev.newIdType.empty() ? "nullptr" : "&" + ev.newIdType + "_interface"), flags, (ev.destructor ? "\n destroyed = true;" : ""), evid, (ev.newIdType.empty() ? "nullptr" : "&" + ev.newIdType + "_interface"), flags, argsN,
(!ev.newIdType.empty() ? ", nullptr" : ""), argsN, (ev.newIdType.empty() ? "\n proxy;" : "\n\n return proxy;")); (ev.newIdType.empty() ? "\n proxy;" : "\n\n return proxy;"));
} }
evid++; evid++;