|
|
dfc2f2 |
From 52ec7edfe9c4fa99e71cefaa89ab4d25888882ca Mon Sep 17 00:00:00 2001
|
|
|
dfc2f2 |
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
|
|
|
dfc2f2 |
Date: Fri, 4 Apr 2014 17:46:33 +0200
|
|
|
dfc2f2 |
Subject: [PATCH] display: signal primary-destroy when clearing all surfaces
|
|
|
dfc2f2 |
|
|
|
dfc2f2 |
When destroying the primary surface, we need to signal it, since
|
|
|
dfc2f2 |
listeners might be referencing the data pointer. Currently, this only
|
|
|
dfc2f2 |
happens during channel finalize().
|
|
|
dfc2f2 |
|
|
|
dfc2f2 |
This could help with rhbz#1082555.
|
|
|
dfc2f2 |
|
|
|
dfc2f2 |
Related: rhbz#1097338
|
|
|
dfc2f2 |
|
|
|
dfc2f2 |
(cherry picked from commit a7e80610e8a7b616b3e502a39052921fb9b51825)
|
|
|
dfc2f2 |
---
|
|
|
dfc2f2 |
gtk/channel-display.c | 6 ++++++
|
|
|
dfc2f2 |
1 file changed, 6 insertions(+)
|
|
|
dfc2f2 |
|
|
|
dfc2f2 |
diff --git a/gtk/channel-display.c b/gtk/channel-display.c
|
|
|
dfc2f2 |
index 739eb47..80df0f3 100644
|
|
|
dfc2f2 |
--- a/gtk/channel-display.c
|
|
|
dfc2f2 |
+++ b/gtk/channel-display.c
|
|
|
dfc2f2 |
@@ -806,12 +806,18 @@ static display_surface *find_surface(SpiceDisplayChannelPrivate *c, guint32 surf
|
|
|
dfc2f2 |
return g_hash_table_lookup(c->surfaces, GINT_TO_POINTER(surface_id));
|
|
|
dfc2f2 |
}
|
|
|
dfc2f2 |
|
|
|
dfc2f2 |
+/* main or coroutine context */
|
|
|
dfc2f2 |
static void clear_surfaces(SpiceChannel *channel, gboolean keep_primary)
|
|
|
dfc2f2 |
{
|
|
|
dfc2f2 |
SpiceDisplayChannelPrivate *c = SPICE_DISPLAY_CHANNEL(channel)->priv;
|
|
|
dfc2f2 |
GHashTableIter iter;
|
|
|
dfc2f2 |
display_surface *surface;
|
|
|
dfc2f2 |
|
|
|
dfc2f2 |
+ if (!keep_primary) {
|
|
|
dfc2f2 |
+ c->primary = NULL;
|
|
|
dfc2f2 |
+ emit_main_context(channel, SPICE_DISPLAY_PRIMARY_DESTROY);
|
|
|
dfc2f2 |
+ }
|
|
|
dfc2f2 |
+
|
|
|
dfc2f2 |
g_hash_table_iter_init(&iter, c->surfaces);
|
|
|
dfc2f2 |
while (g_hash_table_iter_next(&iter, NULL, (gpointer*)&surface)) {
|
|
|
dfc2f2 |
|