[mutter] window-x11: Fizzle out changes to the three different regions
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] window-x11: Fizzle out changes to the three different regions
- Date: Fri, 27 Jun 2014 16:32:44 +0000 (UTC)
commit 203e5335abab1dbac92e9b09921dfb9d2623ae11
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Fri Jun 27 12:17:28 2014 -0400
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 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
index e8c279f..059cc81 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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]