GNOME Bugzilla – Bug 701058
Gtk.StyleContext.get_style_property regression
Last modified: 2013-07-03 09:22:54 UTC
This used to work, but doesn't anymore: from gi.repository import Gtk, GObject w = Gtk.ScrolledWindow() ctx = w.get_style_context() value = GObject.Value() value.init(GObject.TYPE_BOOLEAN) for preset in [True, False]: value.set_boolean(preset) ctx.get_style_property("scrollbars-within-bevel", value) if preset != value.get_boolean(): break else: assert False, "get_style_property didn't actually set anything.." value.unset()
This is fallout from: https://git.gnome.org/browse/pygobject/commit/?id=9e47afe459df942d9f
Created attachment 248270 [details] [review] gimarshallingtests: Add test for GValue pass-by-reference
Created attachment 248271 [details] [review] tests: Add test for pass-by-reference GValue
Created attachment 248272 [details] [review] Re-add support for passing GValue's by reference Fix special casing when marshaling from a Python held GValue to a GValue argument intended for a function call. The re-factoring of GValue marshaling in commit 9e47afe459df942d9f broke this by always making a copy of the GValue. This removed the ability to retrieve values with functions like gtk_style_context_get_style_property.
Created attachment 248273 [details] [review] Re-add support for passing GValue's by reference (3.8) Fix for 3.8 branch.
Comment on attachment 248270 [details] [review] gimarshallingtests: Add test for GValue pass-by-reference Simon, thanks for fixing this! This looks fine to me, please go ahead and push to g-i and pygobject.
Comment on attachment 248273 [details] [review] Re-add support for passing GValue's by reference (3.8) Attachment 248272 [details] pushed as 2a530f7 - Re-add support for passing GValue's by reference
Comment on attachment 248270 [details] [review] gimarshallingtests: Add test for GValue pass-by-reference Attachment 248270 [details] pushed as 049c7fd - gimarshallingtests: Add test for GValue pass-by-reference
Comment on attachment 248271 [details] [review] tests: Add test for pass-by-reference GValue Pushed with "skipUnless" to ensure tests still pass with an older gi version. Attachment 248271 [details] pushed as 40a3cd1 - tests: Add test for pass-by-reference GValue
Attachment 248272 [details] pushed as 4665673 - Re-add support for passing GValue's by reference