GNOME Bugzilla – Bug 623335
Make MetaRectangle a boxed type
Last modified: 2010-07-02 17:15:27 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.
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.
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.
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 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?
(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.
Attachment 165063 [details] pushed as 11a8ab4 - Make MetaRectangle a boxed type [ With the g_free change ]