[metacity] compositor: pass MetaSurface to window_opacity_changed
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] compositor: pass MetaSurface to window_opacity_changed
- Date: Fri, 11 Oct 2019 22:03:31 +0000 (UTC)
commit 1397f8551675b93bd9f7ea032e46bc38330f6a03
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Fri Oct 11 22:32:41 2019 +0300
compositor: pass MetaSurface to window_opacity_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 | 6 ++----
src/compositor/meta-compositor.c | 9 ++++++++-
5 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/src/compositor/meta-compositor-none.c b/src/compositor/meta-compositor-none.c
index 575e5ddb..b564832f 100644
--- a/src/compositor/meta-compositor-none.c
+++ b/src/compositor/meta-compositor-none.c
@@ -62,7 +62,7 @@ meta_compositor_none_hide_window (MetaCompositor *compositor,
static void
meta_compositor_none_window_opacity_changed (MetaCompositor *compositor,
- MetaWindow *window)
+ MetaSurface *surface)
{
}
diff --git a/src/compositor/meta-compositor-private.h b/src/compositor/meta-compositor-private.h
index 1274ac58..c4f41d92 100644
--- a/src/compositor/meta-compositor-private.h
+++ b/src/compositor/meta-compositor-private.h
@@ -47,7 +47,7 @@ struct _MetaCompositorClass
MetaEffectType effect);
void (* window_opacity_changed) (MetaCompositor *compositor,
- MetaWindow *window);
+ MetaSurface *surface);
void (* window_opaque_region_changed) (MetaCompositor *compositor,
MetaWindow *window);
diff --git a/src/compositor/meta-compositor-vulkan.c b/src/compositor/meta-compositor-vulkan.c
index 59d91982..0e551f75 100644
--- a/src/compositor/meta-compositor-vulkan.c
+++ b/src/compositor/meta-compositor-vulkan.c
@@ -1297,7 +1297,7 @@ meta_compositor_vulkan_hide_window (MetaCompositor *compositor,
static void
meta_compositor_vulkan_window_opacity_changed (MetaCompositor *compositor,
- MetaWindow *window)
+ MetaSurface *surface)
{
}
diff --git a/src/compositor/meta-compositor-xrender.c b/src/compositor/meta-compositor-xrender.c
index fc9a6fd7..cd0967db 100644
--- a/src/compositor/meta-compositor-xrender.c
+++ b/src/compositor/meta-compositor-xrender.c
@@ -2464,16 +2464,14 @@ meta_compositor_xrender_hide_window (MetaCompositor *compositor,
static void
meta_compositor_xrender_window_opacity_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");
determine_mode (xrender, cw);
cw->needs_shadow = window_has_shadow (xrender, cw);
diff --git a/src/compositor/meta-compositor.c b/src/compositor/meta-compositor.c
index 27612ea0..4328ffb8 100644
--- a/src/compositor/meta-compositor.c
+++ b/src/compositor/meta-compositor.c
@@ -473,11 +473,18 @@ void
meta_compositor_window_opacity_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_opacity_changed (compositor, window);
+ surface = g_hash_table_lookup (priv->surfaces, window);
+ if (surface == NULL)
+ return;
+
+ compositor_class->window_opacity_changed (compositor, surface);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]