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 623335 - Make MetaRectangle a boxed type
Make MetaRectangle a boxed type
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2010-07-02 00:27 UTC by Owen Taylor
Modified: 2010-07-02 17:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make MetaRectangle a boxed type (2.41 KB, patch)
2010-07-02 00:27 UTC, Owen Taylor
none Details | Review
Make MetaRectangle a boxed type (2.41 KB, patch)
2010-07-02 00:28 UTC, Owen Taylor
none Details | Review
Make MetaRectangle a boxed type (2.30 KB, patch)
2010-07-02 00:29 UTC, Owen Taylor
committed Details | Review

Description Owen Taylor 2010-07-02 00:27:17 UTC
This patch exports MetaRectangle as a boxed type. There's an obvious looking
cleanup of using meta_rectangle_copy() for all the cases in boxes.c of:

 *temp = g_new (MetaRectangle, 1);
 *temp = *rect;

But it gets messy because there's a common function exported in boxes.h that
is supposed to free a GList *either* of MetaRectangle or MetaEdge, so I gave
up after a while on the cleanup.
Comment 1 Owen Taylor 2010-07-02 00:27:19 UTC
Created attachment 165061 [details] [review]
Make MetaRectangle a boxed type

Export a boxed type for MetaRectangle; this is mostly of interest
because GdkRectangle has been turned into a typedef for
cairo_rectangle_int_t which causes massive problems for using it from
gobject-introspection based language bindings.
Comment 2 Owen Taylor 2010-07-02 00:28:23 UTC
Created attachment 165062 [details] [review]
Make MetaRectangle a boxed type

Export a boxed type for MetaRectangle; this is mostly of interest
because GdkRectangle has been turned into a typedef for
cairo_rectangle_int_t which causes massive problems for using it from
gobject-introspection based language bindings.
Comment 3 Owen Taylor 2010-07-02 00:29:20 UTC
Created attachment 165063 [details] [review]
Make MetaRectangle a boxed type

Here's a version without the stray meta_rectangle_new() which
was part of the abandoned cleanup.
Comment 4 Dan Winship 2010-07-02 13:37:20 UTC
Comment on attachment 165063 [details] [review]
Make MetaRectangle a boxed type

seems broken/dangerous to have meta_rectangle_free use g_slice_free when the rest of mutter uses g_malloc/g_free for MetaRectangles. Maybe you just have the boxed type use g_malloc/g_free too?
Comment 5 Owen Taylor 2010-07-02 17:03:54 UTC
(In reply to comment #4)
> (From update of attachment 165063 [details] [review])
> seems broken/dangerous to have meta_rectangle_free use g_slice_free when the
> rest of mutter uses g_malloc/g_free for MetaRectangles. Maybe you just have the
> boxed type use g_malloc/g_free too?

Hmm. I'd rather fix the rest of Metacity (I think it's just the rest of boxes.c?) to be using meta_rectangle_free(), but your probably right that usage of gslice should wait for that cleanup. I'll commit it with the g_malloc/g_free approach to keep things simple.
Comment 6 Owen Taylor 2010-07-02 17:15:24 UTC
Attachment 165063 [details] pushed as 11a8ab4 - Make MetaRectangle a boxed type

[ With the g_free change ]