GNOME Bugzilla – Bug 632474
Remove MetaRegion
Last modified: 2010-10-23 19:50:07 UTC
The new shadow code I'm working on does a lot of region manipulation; rather than further extending MetaRegion it turned out to be simpler to just get rid of it - most of our region usage is internal anyways.
Created attachment 172617 [details] [review] Remove MetaRegion In many places, MetaRegion was being used entirely internally, rather than for gtk2/gtk3 compatibility. In these cases, it's simpler to just depend on cairo-1.10 (for both gtk2 and gtk3) and use cairo_region_t. The few places where we did need GDK compatibility (GdkEvent.region and gdk_window_shape_combine_mask) are replaced with a combination of converting GdkRegion to cairo_region_t and conditional code. https://bugzilla.gnome.org/show_bug.cgi?id=632473
*** Bug 632473 has been marked as a duplicate of this bug. ***
Review of attachment 172617 [details] [review]: Looks good, except for the changes in meta_frames_expose_event(), where the mix of cairo_region_t/GdkRectangle looks a bit odd ... Also, there's a stray reference to bug 632473 in the commit message. ::: src/ui/frames.c @@ +2407,3 @@ + region = cairo_region_create_rectangles ((cairo_rectangle_int_t *)event_rectangles, + n_event_rectangles); + g_free (event_rectangles); Hmmm - given that this is GTK+-2 code, wouldn't it be easier to use the deprecated gdk_region API?
(In reply to comment #3) > Review of attachment 172617 [details] [review]: > > Looks good, except for the changes in meta_frames_expose_event(), where the mix > of cairo_region_t/GdkRectangle looks a bit odd ... > > Also, there's a stray reference to bug 632473 in the commit message. Fixed locally. > ::: src/ui/frames.c > @@ +2407,3 @@ > + region = cairo_region_create_rectangles ((cairo_rectangle_int_t > *)event_rectangles, > + n_event_rectangles); > + g_free (event_rectangles); > > Hmmm - given that this is GTK+-2 code, wouldn't it be easier to use the > deprecated gdk_region API? The problem is the usage of clip_to_screen() and subtract_client_area() in that function - the region leaks out of the #ifdef. Using GdkRegion would mean duplicating those functions, I think. (I considered at one point an alternate patch that kept MetaRegion but used it only where it was actually useful in ui/ and not in the compositor, but it seemed easier to just go ahead and get rid of MetaRegion entirely even if it meant a bit of ugly compat code in a couple of places.)
Comment on attachment 172617 [details] [review] Remove MetaRegion (In reply to comment #4) > The problem is the usage of clip_to_screen() and subtract_client_area() in that > function - the region leaks out of the #ifdef. Using GdkRegion would mean > duplicating those functions, I think. Ah, makes sense then.
Comment on attachment 172617 [details] [review] Remove MetaRegion Pushed as 804117c