[Spice-devel] [PATCH spice-gtk 5/7] usbredir: Shrink the usb device selection dialog when devices are unplugged

Marc-André Lureau marcandre.lureau at gmail.com
Sun Feb 19 06:20:06 PST 2012


ack

On Sun, Feb 19, 2012 at 12:50 AM, Hans de Goede <hdegoede at redhat.com> wrote:
> 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
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel



-- 
Marc-André Lureau


More information about the Spice-devel mailing list