[virt-tools-list] [virt-viewer 2/3] Improve hotkeys controller behaviour

Christophe Fergeau cfergeau at redhat.com
Mon Dec 10 14:42:45 UTC 2012


Disable default accelerators when setting bindings from the controller
in case the controller does not override them all. This ensures we don't
inherit from the bindings set in VirtViewerApp::constructor if the controller
don't set any bindings for a given action.
---
 src/remote-viewer.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/remote-viewer.c b/src/remote-viewer.c
index 31812d6..559f29a 100644
--- a/src/remote-viewer.c
+++ b/src/remote-viewer.c
@@ -514,6 +514,11 @@ spice_ctrl_notified(SpiceCtrlController *ctrl,
             g_object_set(app, "enable-accel", FALSE, NULL);
             goto end;
         }
+        /* Disable default bindings and replace them with our own */
+        gtk_accel_map_change_entry("<virt-viewer>/view/fullscreen", 0, 0, TRUE);
+        gtk_accel_map_change_entry("<virt-viewer>/view/release-cursor", 0, 0, TRUE);
+        gtk_accel_map_change_entry("<virt-viewer>/file/smartcard-insert", 0, 0, TRUE);
+        gtk_accel_map_change_entry("<virt-viewer>/file/smartcard-remove", 0, 0, TRUE);
 
         for (hotkey = hotkeys; *hotkey != NULL; hotkey++) {
             gchar *key = strstr(*hotkey, "=");
-- 
1.8.0.1




More information about the virt-tools-list mailing list