summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2012-01-18 15:06:37 +0100
committerMarc-André Lureau <marcandre.lureau@redhat.com>2012-01-18 15:06:41 +0100
commit7986c81e98efed09c883061bc31c5f0e51bd4620 (patch)
tree14a2f1f7c4c66a2623cff2af1c190bb121d3eb22 /gtk
parente353b220a5939659005d3120b8da50465212acf1 (diff)
gtk-session: ignore destroy of outdated main channel
This solves clipboard sharing not working with a password protected server, since new main channel are created for each connection attempt.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/spice-gtk-session.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gtk/spice-gtk-session.c b/gtk/spice-gtk-session.c
index 32848fa..a7357f8 100644
--- a/gtk/spice-gtk-session.c
+++ b/gtk/spice-gtk-session.c
@@ -743,6 +743,7 @@ static void channel_new(SpiceSession *session, SpiceChannel *channel,
SpiceGtkSessionPrivate *s = self->priv;
if (SPICE_IS_MAIN_CHANNEL(channel)) {
+ SPICE_DEBUG("Changing main channel from %p to %p", s->main, channel);
s->main = SPICE_MAIN_CHANNEL(channel);
g_signal_connect(channel, "main-clipboard-selection-grab",
G_CALLBACK(clipboard_grab), self);
@@ -762,7 +763,7 @@ static void channel_destroy(SpiceSession *session, SpiceChannel *channel,
SpiceGtkSessionPrivate *s = self->priv;
guint i;
- if (SPICE_IS_MAIN_CHANNEL(channel)) {
+ if (SPICE_IS_MAIN_CHANNEL(channel) && SPICE_MAIN_CHANNEL(channel) == s->main) {
s->main = NULL;
for (i = 0; i < CLIPBOARD_LAST; ++i) {
if (s->clipboard_by_guest[i]) {