[gnome-boxes] spice-display: Add env var for redirecting mice & kbd



commit dfff504dcc52ea8a8dc3781118d1ed433582b96d
Author: Thomas Hindoe Paaboel Andersen <phomes gmail com>
Date:   Mon Oct 31 23:08:59 2016 +0100

    spice-display: Add env var for redirecting mice & kbd
    
    Not allowing USB mice and keyboards is a good default. However
    it is useful for testing drivers to be able to do so.
    
    This patch allows redirecting all USB devices if the env var
    BOXES_USB_REDIR_ALL is set.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773924

 src/spice-display.vala |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/spice-display.vala b/src/spice-display.vala
index b118099..0e52e7e 100644
--- a/src/spice-display.vala
+++ b/src/spice-display.vala
@@ -422,6 +422,9 @@ private class Boxes.SpiceDisplay: Boxes.Display {
         GLib.GenericArray<UsbDevice> ret = new GLib.GenericArray<UsbDevice> ();
         var devs = manager.get_devices ();
 
+        if (Environment.get_variable ("BOXES_USB_REDIR_ALL") != null)
+            return devs;
+
         for (int i = 0; i < devs.length; i++) {
             var dev = devs[i];
             var libusb_dev = (LibUSB.Device) dev.get_libusb_device ();


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