Wire up SpiceDisplay grab signals

To ensure that we can put the key release sequence message in the
title bar, wire up VirtViewerDisplaySpice to the grab signals
in SpiceDisplay
This commit is contained in:
Daniel P. Berrange 2011-10-11 10:12:05 +01:00
parent 168af497b9
commit 09ee7d3220

View File

@ -126,6 +126,30 @@ primary_create(SpiceChannel *channel G_GNUC_UNUSED,
}
static void
virt_viewer_display_spice_keyboard_grab(SpiceDisplay *display G_GNUC_UNUSED,
int grabbed,
VirtViewerDisplaySpice *self)
{
if (grabbed)
g_signal_emit_by_name(self, "display-keyboard-grab");
else
g_signal_emit_by_name(self, "display-keyboard-ungrab");
}
static void
virt_viewer_display_spice_mouse_grab(SpiceDisplay *display G_GNUC_UNUSED,
int grabbed,
VirtViewerDisplaySpice *self)
{
if (grabbed)
g_signal_emit_by_name(self, "display-pointer-grab");
else
g_signal_emit_by_name(self, "display-pointer-ungrab");
}
GtkWidget *
virt_viewer_display_spice_new(SpiceChannel *channel,
SpiceDisplay *display)
@ -159,6 +183,13 @@ virt_viewer_display_spice_new(SpiceChannel *channel,
"auto-clipboard", TRUE,
NULL);
g_signal_connect(self->priv->display,
"keyboard-grab",
G_CALLBACK(virt_viewer_display_spice_keyboard_grab), self);
g_signal_connect(self->priv->display,
"mouse-grab",
G_CALLBACK(virt_viewer_display_spice_mouse_grab), self);
return GTK_WIDGET(self);
}