pygobject3/struct-pointers.patch
2012-11-26 10:14:06 -06:00

34 lines
1.4 KiB
Diff

From da049efee691fcf6f9d3cd6bb270ee11b3a34b65 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlos@lanedo.com>
Date: Tue, 13 Nov 2012 18:24:28 +0100
Subject: [PATCH 3/3] Fix marshalling of arrays of struct pointers to Python
Fill in the pointer to the struct, not the pointer to the
array position. This makes the GdkAtom** argument in
gtk_clipboard_wait_for_targets() work.
https://bugzilla.gnome.org/show_bug.cgi?id=678620
---
gi/pygi-marshal-to-py.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gi/pygi-marshal-to-py.c b/gi/pygi-marshal-to-py.c
index 811d8b0..950895d 100644
--- a/gi/pygi-marshal-to-py.c
+++ b/gi/pygi-marshal-to-py.c
@@ -439,7 +439,10 @@ _pygi_marshal_to_py_array (PyGIInvokeState *state,
memcpy (_struct, array_->data + i * item_size,
item_size);
item_arg.v_pointer = _struct;
- } else
+ } else if (item_arg_cache->is_pointer)
+ /* this is the case for GAtom* arrays */
+ item_arg.v_pointer = g_array_index (array_, gpointer, i);
+ else
item_arg.v_pointer = array_->data + i * item_size;
break;
default:
--
1.7.11.7