diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2012-01-31 23:03:22 +0100 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2012-01-31 23:23:22 +0100 |
commit | 5f39af6b88407752984dbf6f8943408e790d2f21 (patch) | |
tree | 934d87666b326244e9d4bbfc469f6e468899689c /gtk/channel-main.c | |
parent | aaed1f583fe8e502f63869cfc0b801823de90878 (diff) |
Do not grab/release the clipboard on guest without clipboard support
Add an agent capability check before calling those functions from
gtk-session. Avoid extra warnings.
Diffstat (limited to 'gtk/channel-main.c')
-rw-r--r-- | gtk/channel-main.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gtk/channel-main.c b/gtk/channel-main.c index b2df547..0689368 100644 --- a/gtk/channel-main.c +++ b/gtk/channel-main.c @@ -736,6 +736,7 @@ static void do_emit_main_context(GObject *object, int signum, gpointer params) /* ------------------------------------------------------------------ */ + static void agent_free_msg_queue(SpiceMainChannel *channel) { SpiceMainChannelPrivate *c = channel->priv; @@ -1716,6 +1717,27 @@ static gboolean timer_set_display(gpointer data) } /** + * spice_main_agent_test_capability: + * @channel: + * @cap: an agent capability identifier + * + * Test capability of a remote agent. + * + * Returns: %TRUE if @cap (channel kind capability) is available. + **/ +gboolean spice_main_agent_test_capability(SpiceMainChannel *channel, guint32 cap) +{ + g_return_val_if_fail(SPICE_IS_MAIN_CHANNEL(channel), FALSE); + + SpiceMainChannelPrivate *c = channel->priv; + + if (!c->agent_caps_received) + return FALSE; + + return VD_AGENT_HAS_CAPABILITY(c->agent_caps, sizeof(c->agent_caps), cap); +} + +/** * spice_main_set_display: * @channel: * @id: display channel ID |