[metacity] compositor: pass MetaSurface to remove_window
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] compositor: pass MetaSurface to remove_window
- Date: Mon, 21 Oct 2019 05:21:28 +0000 (UTC)
commit 3dcc5fe418fa8b5248f3c4429d02be8edaee22e2
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sun Oct 20 19:54:39 2019 +0300
compositor: pass MetaSurface to remove_window
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 | 5 ++---
5 files changed, 8 insertions(+), 11 deletions(-)
---
diff --git a/src/compositor/meta-compositor-none.c b/src/compositor/meta-compositor-none.c
index e873c1cc..63114daf 100644
--- a/src/compositor/meta-compositor-none.c
+++ b/src/compositor/meta-compositor-none.c
@@ -42,7 +42,7 @@ meta_compositor_none_add_window (MetaCompositor *compositor,
static void
meta_compositor_none_remove_window (MetaCompositor *compositor,
- MetaWindow *window)
+ MetaSurface *surface)
{
}
diff --git a/src/compositor/meta-compositor-private.h b/src/compositor/meta-compositor-private.h
index 006cc199..5872e66c 100644
--- a/src/compositor/meta-compositor-private.h
+++ b/src/compositor/meta-compositor-private.h
@@ -36,7 +36,7 @@ struct _MetaCompositorClass
MetaWindow *window);
void (* remove_window) (MetaCompositor *compositor,
- MetaWindow *window);
+ MetaSurface *surface);
void (* hide_window) (MetaCompositor *compositor,
MetaSurface *surface,
diff --git a/src/compositor/meta-compositor-vulkan.c b/src/compositor/meta-compositor-vulkan.c
index 8a91ad6b..70ace60d 100644
--- a/src/compositor/meta-compositor-vulkan.c
+++ b/src/compositor/meta-compositor-vulkan.c
@@ -1277,7 +1277,7 @@ meta_compositor_vulkan_add_window (MetaCompositor *compositor,
static void
meta_compositor_vulkan_remove_window (MetaCompositor *compositor,
- MetaWindow *window)
+ MetaSurface *surface)
{
}
diff --git a/src/compositor/meta-compositor-xrender.c b/src/compositor/meta-compositor-xrender.c
index 068e3233..2fa0e6e7 100644
--- a/src/compositor/meta-compositor-xrender.c
+++ b/src/compositor/meta-compositor-xrender.c
@@ -1471,7 +1471,7 @@ meta_compositor_xrender_add_window (MetaCompositor *compositor,
static void
meta_compositor_xrender_remove_window (MetaCompositor *compositor,
- MetaWindow *window)
+ MetaSurface *surface)
{
MetaCompositorXRender *xrender;
MetaCompWindow *cw;
@@ -1479,13 +1479,11 @@ meta_compositor_xrender_remove_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");
shadow_changed (xrender, cw);
- xwindow = meta_window_get_xwindow (window);
+ xwindow = meta_window_get_xwindow (cw->window);
g_hash_table_remove (xrender->windows_by_xid, (gpointer) xwindow);
}
diff --git a/src/compositor/meta-compositor.c b/src/compositor/meta-compositor.c
index a9c2864e..9dc466fe 100644
--- a/src/compositor/meta-compositor.c
+++ b/src/compositor/meta-compositor.c
@@ -430,13 +430,12 @@ meta_compositor_remove_window (MetaCompositor *compositor,
priv = meta_compositor_get_instance_private (compositor);
- META_COMPOSITOR_GET_CLASS (compositor)->remove_window (compositor, window);
-
surface = g_hash_table_lookup (priv->surfaces, window);
-
if (surface == NULL)
return;
+ META_COMPOSITOR_GET_CLASS (compositor)->remove_window (compositor, surface);
+
priv->stack = g_list_remove (priv->stack, surface);
g_hash_table_remove (priv->surfaces, window);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]