summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk/channel-inputs.c12
-rw-r--r--gtk/spice-channel-enums.h2
-rw-r--r--gtk/spice-session.c3
-rw-r--r--gtk/spice-widget.c1
4 files changed, 11 insertions, 7 deletions
diff --git a/gtk/channel-inputs.c b/gtk/channel-inputs.c
index 8eaf7bb..827f269 100644
--- a/gtk/channel-inputs.c
+++ b/gtk/channel-inputs.c
@@ -317,7 +317,9 @@ void spice_inputs_motion(SpiceInputsChannel *channel, gint dx, gint dy,
spice_inputs_channel *c;
g_return_if_fail(channel != NULL);
- g_return_if_fail(SPICE_CHANNEL(channel)->priv->state == SPICE_CHANNEL_STATE_READY);
+ g_return_if_fail(SPICE_CHANNEL(channel)->priv->state != SPICE_CHANNEL_STATE_UNCONNECTED);
+ if (SPICE_CHANNEL(channel)->priv->state != SPICE_CHANNEL_STATE_READY)
+ return;
c = channel->priv;
c->bs = button_state;
@@ -467,7 +469,9 @@ void spice_inputs_key_press(SpiceInputsChannel *channel, guint scancode)
spice_msg_out *msg;
g_return_if_fail(channel != NULL);
- g_return_if_fail(SPICE_CHANNEL(channel)->priv->state == SPICE_CHANNEL_STATE_READY);
+ g_return_if_fail(SPICE_CHANNEL(channel)->priv->state != SPICE_CHANNEL_STATE_UNCONNECTED);
+ if (SPICE_CHANNEL(channel)->priv->state != SPICE_CHANNEL_STATE_READY)
+ return;
SPICE_DEBUG("%s: scancode %d", __FUNCTION__, scancode);
if (scancode < 0x100) {
@@ -496,7 +500,9 @@ void spice_inputs_key_release(SpiceInputsChannel *channel, guint scancode)
spice_msg_out *msg;
g_return_if_fail(channel != NULL);
- g_return_if_fail(SPICE_CHANNEL(channel)->priv->state == SPICE_CHANNEL_STATE_READY);
+ g_return_if_fail(SPICE_CHANNEL(channel)->priv->state != SPICE_CHANNEL_STATE_UNCONNECTED);
+ if (SPICE_CHANNEL(channel)->priv->state != SPICE_CHANNEL_STATE_READY)
+ return;
SPICE_DEBUG("%s: scancode %d", __FUNCTION__, scancode);
if (scancode < 0x100) {
diff --git a/gtk/spice-channel-enums.h b/gtk/spice-channel-enums.h
index 0ba0f78..30bfa51 100644
--- a/gtk/spice-channel-enums.h
+++ b/gtk/spice-channel-enums.h
@@ -1,7 +1,7 @@
#ifndef SPICE_CHANNEL_ENUMS_H
#define SPICE_CHANNEL_ENUMS_H
-#warning "deprecated: please include spice-glib.enums.h"
+#warning "deprecated: please include spice-glib-enums.h"
#include "spice-glib-enums.h"
#endif /* SPICE_CHANNEL_ENUMS_H */
diff --git a/gtk/spice-session.c b/gtk/spice-session.c
index 722630f..dd95d93 100644
--- a/gtk/spice-session.c
+++ b/gtk/spice-session.c
@@ -641,8 +641,7 @@ void spice_session_migrate_disconnect(SpiceSession *session)
spice_channel_destroy(item->channel); /* /!\ item and channel are destroy() after this call */
}
- g_warn_if_fail(!ring_is_empty(&s->channels) &&
- ring_get_head(&s->channels) == ring_get_tail(&s->channels));
+ g_warn_if_fail(!ring_is_empty(&s->channels)); /* ring_get_length() == 1 */
}
G_GNUC_INTERNAL
diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index 448ecf8..9e88f5b 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -1683,7 +1683,6 @@ static void channel_destroy(SpiceSession *s, SpiceChannel *channel, gpointer dat
}
if (SPICE_IS_INPUTS_CHANNEL(channel)) {
- release_keys(display);
d->inputs = NULL;
return;
}