mirror of
https://gitlab.com/virt-viewer/virt-viewer.git
synced 2025-01-25 06:03:42 +03:00
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:
parent
168af497b9
commit
09ee7d3220
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user