[metacity] compositor: pass MetaSurface to hide_window vfunc



commit b9581acd2c31f741e4e7d94bc8412af1a59c31a3
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Oct 11 16:04:22 2019 +0300

    compositor: pass MetaSurface to hide_window vfunc

 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 106b0a59..575e5ddb 100644
--- a/src/compositor/meta-compositor-none.c
+++ b/src/compositor/meta-compositor-none.c
@@ -55,7 +55,7 @@ meta_compositor_none_show_window (MetaCompositor *compositor,
 
 static void
 meta_compositor_none_hide_window (MetaCompositor *compositor,
-                                  MetaWindow     *window,
+                                  MetaSurface    *surface,
                                   MetaEffectType  effect)
 {
 }
diff --git a/src/compositor/meta-compositor-private.h b/src/compositor/meta-compositor-private.h
index 64b479f9..1274ac58 100644
--- a/src/compositor/meta-compositor-private.h
+++ b/src/compositor/meta-compositor-private.h
@@ -43,7 +43,7 @@ struct _MetaCompositorClass
                                                       MetaEffectType      effect);
 
   void              (* hide_window)                  (MetaCompositor     *compositor,
-                                                      MetaWindow         *window,
+                                                      MetaSurface        *surface,
                                                       MetaEffectType      effect);
 
   void              (* window_opacity_changed)       (MetaCompositor     *compositor,
diff --git a/src/compositor/meta-compositor-vulkan.c b/src/compositor/meta-compositor-vulkan.c
index 970034aa..59d91982 100644
--- a/src/compositor/meta-compositor-vulkan.c
+++ b/src/compositor/meta-compositor-vulkan.c
@@ -1290,7 +1290,7 @@ meta_compositor_vulkan_show_window (MetaCompositor *compositor,
 
 static void
 meta_compositor_vulkan_hide_window (MetaCompositor *compositor,
-                                    MetaWindow     *window,
+                                    MetaSurface    *surface,
                                     MetaEffectType  effect)
 {
 }
diff --git a/src/compositor/meta-compositor-xrender.c b/src/compositor/meta-compositor-xrender.c
index d0c1f902..2ddd4ce3 100644
--- a/src/compositor/meta-compositor-xrender.c
+++ b/src/compositor/meta-compositor-xrender.c
@@ -2440,7 +2440,7 @@ meta_compositor_xrender_show_window (MetaCompositor *compositor,
 
 static void
 meta_compositor_xrender_hide_window (MetaCompositor *compositor,
-                                     MetaWindow     *window,
+                                     MetaSurface    *surface,
                                      MetaEffectType  effect)
 {
   MetaCompositorXRender *xrender;
@@ -2448,9 +2448,7 @@ meta_compositor_xrender_hide_window (MetaCompositor *compositor,
 
   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");
 
   cw->damaged = FALSE;
 
diff --git a/src/compositor/meta-compositor.c b/src/compositor/meta-compositor.c
index a6ae23c1..f71f6de5 100644
--- a/src/compositor/meta-compositor.c
+++ b/src/compositor/meta-compositor.c
@@ -454,11 +454,18 @@ meta_compositor_hide_window (MetaCompositor *compositor,
                              MetaWindow     *window,
                              MetaEffectType  effect)
 {
+  MetaCompositorPrivate *priv;
   MetaCompositorClass *compositor_class;
+  MetaSurface *surface;
 
+  priv = meta_compositor_get_instance_private (compositor);
   compositor_class = META_COMPOSITOR_GET_CLASS (compositor);
 
-  compositor_class->hide_window (compositor, window, effect);
+  surface = g_hash_table_lookup (priv->surfaces, window);
+  if (surface == NULL)
+    return;
+
+  compositor_class->hide_window (compositor, surface, effect);
 }
 
 void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]