From 04ecfa9a3039ddda99e6d568dd0c4e40d3047d90 Mon Sep 17 00:00:00 2001 From: Ryan Gonzalez Date: Wed, 26 Feb 2025 10:20:19 -0600 Subject: [PATCH] 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 --- gio/gdbus-2.0/codegen/dbustypes.py | 6 ++++-- gio/tests/codegen.py | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gio/gdbus-2.0/codegen/dbustypes.py b/gio/gdbus-2.0/codegen/dbustypes.py index 5b33f07cb..da58c74f9 100644 --- a/gio/gdbus-2.0/codegen/dbustypes.py +++ b/gio/gdbus-2.0/codegen/dbustypes.py @@ -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) diff --git a/gio/tests/codegen.py b/gio/tests/codegen.py index 7d5dcfd97..0a054202f 100644 --- a/gio/tests/codegen.py +++ b/gio/tests/codegen.py @@ -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})"),