summaryrefslogtreecommitdiff
path: root/gtk/spice-gtk-session.h
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@redhat.com>2014-03-31 10:52:49 -0500
committerJonathon Jongsma <jjongsma@redhat.com>2014-04-03 16:07:25 -0500
commit9c75c7ee33d8567fef88594ae7844b9121c6291f (patch)
treec7b77e0643b428e8a9fd8bf8f30d44212d0fe128 /gtk/spice-gtk-session.h
parent31c099c931c3717543b6c6db2d1af4d68f49063f (diff)
Ensure keyboard modifiers are synchronized properly
In certain circumstances, the keyboard modifiers get out-of-sync between the guest and the client. This is easy to reproduce with the following steps: - launch virt-viewer with a guest that is not running - start the guest - while guest is booting, enable CAPS LOCK on the client - after guest finishes booting, it will set its modifiers to a default value (e.g. numlock on, capslock off) - now capslock is OFF in the guest, but ON in the client - toggle caps lock - now capslock is ON in the guest, but OFF in the client This moves the responsibility for synchronizing client and guest modifiers into SpiceGtkSession. It can't be handled easily within the SpiceDisplay widget since there can be multiple display widgets for each inputs channel. A new function (spice_gtk_session_sync_keyboard_modifiers()) was added so that synchronization can be triggered manually if desired. But it also registers a signal handler for the InputsChannel::inputs-modifiers signal to detect when the guest has changed its modifiers. The signal handler simply overrides the guests modifiers and sets them back to the value from the client.
Diffstat (limited to 'gtk/spice-gtk-session.h')
-rw-r--r--gtk/spice-gtk-session.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/gtk/spice-gtk-session.h b/gtk/spice-gtk-session.h
index 3b4eac6..fbcc353 100644
--- a/gtk/spice-gtk-session.h
+++ b/gtk/spice-gtk-session.h
@@ -59,6 +59,7 @@ GType spice_gtk_session_get_type(void);
SpiceGtkSession *spice_gtk_session_get(SpiceSession *session);
void spice_gtk_session_copy_to_guest(SpiceGtkSession *self);
void spice_gtk_session_paste_from_guest(SpiceGtkSession *self);
+void spice_gtk_session_sync_keyboard_modifiers(SpiceGtkSession *self);
G_END_DECLS