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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list


[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux