window-x11: Fizzle out changes to the three different regions

GTK+ likes to set these, well, _NET_WM_OPAQUE_REGION in particular, to
the same value. Save some expensive and processing when this happens. We
should probably make GTK+ smarter.
This commit is contained in:
Jasper St. Pierre 2014-06-27 12:17:28 -04:00
parent f1d8428650
commit 203e5335ab

View File

@ -1685,6 +1685,9 @@ static void
meta_window_set_opaque_region (MetaWindow *window, meta_window_set_opaque_region (MetaWindow *window,
cairo_region_t *region) cairo_region_t *region)
{ {
if (cairo_region_equal (window->opaque_region, region))
return;
g_clear_pointer (&window->opaque_region, cairo_region_destroy); g_clear_pointer (&window->opaque_region, cairo_region_destroy);
if (region != NULL) if (region != NULL)
@ -1770,6 +1773,9 @@ static void
meta_window_set_input_region (MetaWindow *window, meta_window_set_input_region (MetaWindow *window,
cairo_region_t *region) cairo_region_t *region)
{ {
if (cairo_region_equal (window->input_region, region))
return;
g_clear_pointer (&window->input_region, cairo_region_destroy); g_clear_pointer (&window->input_region, cairo_region_destroy);
if (region != NULL) if (region != NULL)
@ -1876,6 +1882,9 @@ static void
meta_window_set_shape_region (MetaWindow *window, meta_window_set_shape_region (MetaWindow *window,
cairo_region_t *region) cairo_region_t *region)
{ {
if (cairo_region_equal (window->shape_region, region))
return;
g_clear_pointer (&window->shape_region, cairo_region_destroy); g_clear_pointer (&window->shape_region, cairo_region_destroy);
if (region != NULL) if (region != NULL)