[Spice-devel] [PATCH spice-gtk 5/7] usbredir: Shrink the usb device selection dialog when devices are unplugged
Hans de Goede
hdegoede at redhat.com
Sat Feb 18 15:50:22 PST 2012
Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
gtk/spicy.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/gtk/spicy.c b/gtk/spicy.c
index cbc702e..2757bd7 100644
--- a/gtk/spicy.c
+++ b/gtk/spicy.c
@@ -419,6 +419,11 @@ static void menu_cb_remove_smartcard(GtkAction *action, void *data)
#endif
#ifdef USE_USBREDIR
+static void remove_cb(GtkContainer *container, GtkWidget *widget, void *data)
+{
+ gtk_window_resize(GTK_WINDOW(data), 1, 1);
+}
+
static void menu_cb_select_usb_devices(GtkAction *action, void *data)
{
GtkWidget *dialog, *area, *usb_device_widget;
@@ -440,6 +445,10 @@ static void menu_cb_select_usb_devices(GtkAction *action, void *data)
G_CALLBACK(usb_connect_failed), NULL);
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.5
More information about the Spice-devel
mailing list