From 203e5335abab1dbac92e9b09921dfb9d2623ae11 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Fri, 27 Jun 2014 12:17:28 -0400 Subject: [PATCH] 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. --- src/x11/window-x11.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c index e8c279f6d..059cc8163 100644 --- a/src/x11/window-x11.c +++ b/src/x11/window-x11.c @@ -1685,6 +1685,9 @@ static void meta_window_set_opaque_region (MetaWindow *window, cairo_region_t *region) { + if (cairo_region_equal (window->opaque_region, region)) + return; + g_clear_pointer (&window->opaque_region, cairo_region_destroy); if (region != NULL) @@ -1770,6 +1773,9 @@ static void meta_window_set_input_region (MetaWindow *window, cairo_region_t *region) { + if (cairo_region_equal (window->input_region, region)) + return; + g_clear_pointer (&window->input_region, cairo_region_destroy); if (region != NULL) @@ -1876,6 +1882,9 @@ static void meta_window_set_shape_region (MetaWindow *window, cairo_region_t *region) { + if (cairo_region_equal (window->shape_region, region)) + return; + g_clear_pointer (&window->shape_region, cairo_region_destroy); if (region != NULL)