summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ã…dahl <jadahl@gmail.com>2019-06-07 13:49:40 +0000
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2019-06-07 16:22:05 +0000
commite716f9d143c00f23a09528ad9ddc4f9ea86c2375 (patch)
tree7d4cd08c6029fe228fae70cc26c71354244baa8c
parent13a1624c1050c91cd4d8a298f7a10fafe56fe9e5 (diff)
downloadmutter-e716f9d143c00f23a09528ad9ddc4f9ea86c2375.tar.gz
wayland/surface: Clear texture when attaching NULL
When 252e64a0eae61735a912d41817c6e6f24824146b moved the texture ownership to MetaWaylandSurface, it failed to handle the case when a NULL-buffer is attached, leaving the texture reference in place. This caused issues when the surface should have been hidden (e.g. attaching a NULL buffer to a cursor surface for hiding the cursor sprite). Related: https://gitlab.gnome.org/GNOME/mutter/issues/630 (cherry picked from commit 5eac1d696dceb62074f9560b82be233bc55ee108)
-rw-r--r--src/wayland/meta-wayland-surface.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index da0acfcbb..391bcc6dd 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -737,6 +737,10 @@ meta_wayland_surface_apply_pending_state (MetaWaylandSurface *surface,
g_clear_pointer (&snippet, cogl_object_unref);
}
}
+ else
+ {
+ cogl_clear_object (&surface->texture);
+ }
/* If the newly attached buffer is going to be accessed directly without
* making a copy, such as an EGL buffer, mark it as in-use don't release