[Spice-devel] [spice-gtk Win32 PATCH 6/7] Windows: spicy: listen to USB device plug/unplug events

Uri Lublin uril at redhat.com
Mon May 7 06:15:38 PDT 2012


---
 gtk/spicy.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/gtk/spicy.c b/gtk/spicy.c
index f44642f..4c9708b 100644
--- a/gtk/spicy.c
+++ b/gtk/spicy.c
@@ -1319,6 +1319,21 @@ static SpiceWindow *create_spice_window(spice_connection *conn, int id, SpiceCha

     gtk_widget_grab_focus(win->spice);

+
+#ifdef USE_USBREDIR
+#ifdef WIN32
+    SpiceUsbDeviceManager *manager = spice_usb_device_manager_get(conn->session,
+                                                                  NULL);
+    /* widget must be realized for geting its window */
+    gtk_widget_realize(win->toplevel);
+    GdkWindow *w = gtk_widget_get_window(win->toplevel);
+    /* Set window for receiving Windows device change notifications */
+    if (manager && w) {
+        spice_usb_device_manager_set_window(manager, w);
+    }
+#endif
+#endif
+
     return win;
 }

-- 
1.7.7.6



More information about the Spice-devel mailing list