[metacity] compositor: pass MetaSurface to window_shape_region_changed
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] compositor: pass MetaSurface to window_shape_region_changed
- Date: Sun, 13 Oct 2019 18:29:54 +0000 (UTC)
commit d100531e3d44d3b61ad34eee87254420416eaa19
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sun Oct 13 20:40:56 2019 +0300
compositor: pass MetaSurface to window_shape_region_changed
src/compositor/meta-compositor-none.c | 2 +-
src/compositor/meta-compositor-private.h | 2 +-
src/compositor/meta-compositor-vulkan.c | 2 +-
src/compositor/meta-compositor-xrender.c | 8 +++-----
src/compositor/meta-compositor.c | 9 ++++++++-
5 files changed, 14 insertions(+), 9 deletions(-)
---
diff --git a/src/compositor/meta-compositor-none.c b/src/compositor/meta-compositor-none.c
index b4f45074..7c5f9cd3 100644
--- a/src/compositor/meta-compositor-none.c
+++ b/src/compositor/meta-compositor-none.c
@@ -74,7 +74,7 @@ meta_compositor_none_window_opaque_region_changed (MetaCompositor *compositor,
static void
meta_compositor_none_window_shape_region_changed (MetaCompositor *compositor,
- MetaWindow *window)
+ MetaSurface *surface)
{
}
diff --git a/src/compositor/meta-compositor-private.h b/src/compositor/meta-compositor-private.h
index 840a7639..ba3c7cc7 100644
--- a/src/compositor/meta-compositor-private.h
+++ b/src/compositor/meta-compositor-private.h
@@ -53,7 +53,7 @@ struct _MetaCompositorClass
MetaSurface *surface);
void (* window_shape_region_changed) (MetaCompositor *compositor,
- MetaWindow *window);
+ MetaSurface *surface);
void (* set_updates_frozen) (MetaCompositor *compositor,
MetaWindow *window,
diff --git a/src/compositor/meta-compositor-vulkan.c b/src/compositor/meta-compositor-vulkan.c
index cdbbd432..b07d3015 100644
--- a/src/compositor/meta-compositor-vulkan.c
+++ b/src/compositor/meta-compositor-vulkan.c
@@ -1309,7 +1309,7 @@ meta_compositor_vulkan_window_opaque_region_changed (MetaCompositor *compositor,
static void
meta_compositor_vulkan_window_shape_region_changed (MetaCompositor *compositor,
- MetaWindow *window)
+ MetaSurface *surface)
{
}
diff --git a/src/compositor/meta-compositor-xrender.c b/src/compositor/meta-compositor-xrender.c
index 9f8b40a9..26a894d3 100644
--- a/src/compositor/meta-compositor-xrender.c
+++ b/src/compositor/meta-compositor-xrender.c
@@ -2172,16 +2172,14 @@ meta_compositor_xrender_window_opaque_region_changed (MetaCompositor *compositor
static void
meta_compositor_xrender_window_shape_region_changed (MetaCompositor *compositor,
- MetaWindow *window)
+ MetaSurface *surface)
{
MetaCompositorXRender *xrender;
MetaCompWindow *cw;
xrender = META_COMPOSITOR_XRENDER (compositor);
- cw = find_comp_window_by_window (xrender, window);
- if (cw == NULL)
- return;
+ cw = g_object_get_data (G_OBJECT (surface), "cw");
if (cw->shape_region != None)
{
@@ -2208,7 +2206,7 @@ meta_compositor_xrender_window_shape_region_changed (MetaCompositor *compositor,
}
cw->shape_region = cairo_region_to_xserver_region (xrender->xdisplay,
- window->shape_region);
+ cw->window->shape_region);
if (cw->shape_region != None)
{
diff --git a/src/compositor/meta-compositor.c b/src/compositor/meta-compositor.c
index 187e5936..f407df3f 100644
--- a/src/compositor/meta-compositor.c
+++ b/src/compositor/meta-compositor.c
@@ -510,11 +510,18 @@ void
meta_compositor_window_shape_region_changed (MetaCompositor *compositor,
MetaWindow *window)
{
+ MetaCompositorPrivate *priv;
MetaCompositorClass *compositor_class;
+ MetaSurface *surface;
+ priv = meta_compositor_get_instance_private (compositor);
compositor_class = META_COMPOSITOR_GET_CLASS (compositor);
- compositor_class->window_shape_region_changed (compositor, window);
+ surface = g_hash_table_lookup (priv->surfaces, window);
+ if (surface == NULL)
+ return;
+
+ compositor_class->window_shape_region_changed (compositor, surface);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]