[virt-tools-list] [PATCH 01/11] usbredir: Shrink the usb device selection dialog when devices are unplugged

Hans de Goede hdegoede at redhat.com
Sun Mar 4 19:05:52 UTC 2012


Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 src/virt-viewer-session-spice.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
index 51ecebf..1d6c592 100644
--- a/src/virt-viewer-session-spice.c
+++ b/src/virt-viewer-session-spice.c
@@ -347,6 +347,13 @@ virt_viewer_session_spice_has_usb(VirtViewerSession *session)
                                        SPICE_CHANNEL_USBREDIR);
 }
 
+static void remove_cb(GtkContainer   *container G_GNUC_UNUSED,
+                      GtkWidget      *widget G_GNUC_UNUSED,
+                      void           *user_data)
+{
+    gtk_window_resize(GTK_WINDOW(user_data), 1, 1);
+}
+
 static void
 virt_viewer_session_spice_usb_device_selection(VirtViewerSession *session,
                                                GtkWindow *parent)
@@ -369,6 +376,10 @@ virt_viewer_session_spice_usb_device_selection(VirtViewerSession *session,
                      G_CALLBACK(usb_connect_failed), self);
     gtk_box_pack_start(GTK_BOX(area), usb_device_widget, TRUE, TRUE, 5);
 
+    /* This shrinks the dialog when USB devices are unplugged */
+    g_signal_connect(usb_device_widget, "remove",
+                     G_CALLBACK(remove_cb), dialog);
+
     /* show and run */
     gtk_widget_show_all(dialog);
     gtk_dialog_run(GTK_DIALOG(dialog));
-- 
1.7.7.6




More information about the virt-tools-list mailing list