gdbus-codegen: Fix callback GUnixFDList parameter order

GUnixFDList actually comes *after* the GDBusMethodInvocation, but this
was mistakenly putting it first.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
This commit is contained in:
Ryan Gonzalez 2025-02-26 10:20:19 -06:00
parent 22c1762dff
commit 04ecfa9a30
2 changed files with 9 additions and 2 deletions

View File

@ -461,7 +461,7 @@ class Method:
method_invocation_arg.gvalue_type = "object"
method_invocation_arg.gvalue_get = "g_marshal_value_peek_object"
method_invocation_arg.gclosure_marshaller = None
self.marshaller_in_args = [method_invocation_arg] + self.in_args
self.marshaller_in_args = [method_invocation_arg]
if self.unix_fd:
fd_list_arg = Arg("fd_list", None)
@ -469,7 +469,9 @@ class Method:
fd_list_arg.gvalue_type = "object"
fd_list_arg.gvalue_get = "g_marshal_value_peek_object"
fd_list_arg.gclosure_marshaller = None
self.marshaller_in_args.insert(0, fd_list_arg)
self.marshaller_in_args.append(fd_list_arg)
self.marshaller_in_args.extend(self.in_args)
for a in self.annotations:
a.post_process(interface_prefix, cns, cns_upper, cns_lower, self)

View File

@ -1352,6 +1352,11 @@ G_END_DECLS
self.assertIs(stripped_out.count(f"{func_name},"), 1)
self.assertIs(stripped_out.count(f"{func_name} ("), 1)
self.assertLess(
stripped_out.index("arg_method_invocation"),
stripped_out.index("arg_fd_list"),
)
index = 1
self.assertIs(
stripped_out.count(f"g_marshal_value_peek_object (param_values + {index})"),