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 632474 - Remove MetaRegion
Remove MetaRegion
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Florian Müllner
mutter-maint
: 632473 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-10-18 15:40 UTC by Owen Taylor
Modified: 2010-10-23 19:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Remove MetaRegion (35.86 KB, patch)
2010-10-18 15:40 UTC, Owen Taylor
committed Details | Review

Description Owen Taylor 2010-10-18 15:40:03 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.
Comment 1 Owen Taylor 2010-10-18 15:40:05 UTC
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
Comment 2 Owen Taylor 2010-10-18 15:55:46 UTC
*** Bug 632473 has been marked as a duplicate of this bug. ***
Comment 3 Florian Müllner 2010-10-19 18:06:22 UTC
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?
Comment 4 Owen Taylor 2010-10-19 18:31:54 UTC
(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 5 Florian Müllner 2010-10-19 18:44:17 UTC
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 6 Owen Taylor 2010-10-23 19:49:58 UTC
Comment on attachment 172617 [details] [review]
Remove MetaRegion

Pushed as 804117c