After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 701058 - Gtk.StyleContext.get_style_property regression
Gtk.StyleContext.get_style_property regression
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2013-05-26 18:25 UTC by Christoph Reiter (lazka)
Modified: 2013-07-03 09:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gimarshallingtests: Add test for GValue pass-by-reference (1.63 KB, patch)
2013-07-03 02:21 UTC, Simon Feltman
committed Details | Review
tests: Add test for pass-by-reference GValue (1001 bytes, patch)
2013-07-03 02:22 UTC, Simon Feltman
committed Details | Review
Re-add support for passing GValue's by reference (4.94 KB, patch)
2013-07-03 02:22 UTC, Simon Feltman
committed Details | Review
Re-add support for passing GValue's by reference (3.8) (3.96 KB, patch)
2013-07-03 02:24 UTC, Simon Feltman
committed Details | Review

Description Christoph Reiter (lazka) 2013-05-26 18:25:25 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()
Comment 1 Simon Feltman 2013-06-30 10:16:07 UTC
This is fallout from:
https://git.gnome.org/browse/pygobject/commit/?id=9e47afe459df942d9f
Comment 2 Simon Feltman 2013-07-03 02:21:21 UTC
Created attachment 248270 [details] [review]
gimarshallingtests: Add test for GValue pass-by-reference
Comment 3 Simon Feltman 2013-07-03 02:22:04 UTC
Created attachment 248271 [details] [review]
tests: Add test for pass-by-reference GValue
Comment 4 Simon Feltman 2013-07-03 02:22:21 UTC
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.
Comment 5 Simon Feltman 2013-07-03 02:24:00 UTC
Created attachment 248273 [details] [review]
Re-add support for passing GValue's by reference (3.8)

Fix for 3.8 branch.
Comment 6 Martin Pitt 2013-07-03 08:33:56 UTC
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 7 Simon Feltman 2013-07-03 08:54:44 UTC
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 8 Simon Feltman 2013-07-03 09:13:46 UTC
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 9 Simon Feltman 2013-07-03 09:22:33 UTC
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
Comment 10 Simon Feltman 2013-07-03 09:22:52 UTC
Attachment 248272 [details] pushed as 4665673 - Re-add support for passing GValue's by reference