[virt-tools-list] [PATCH virt-viewer] Don't disable "send key" menu when display isn't ready

Fabiano Fidêncio fabiano at fidencio.org
Wed Oct 15 21:51:27 UTC 2014


On Wed, Oct 15, 2014 at 7:44 PM, Jonathon Jongsma <jjongsma at redhat.com> wrote:
> The ability to send a keystroke should not depend on whether a display
> is ready or not, it only depends on whether the display exists or not.
>
> See https://bugzilla.redhat.com/show_bug.cgi?id=1152574
> ---
>  src/virt-viewer-window.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
> index 64cf865..23cc488 100644
> --- a/src/virt-viewer-window.c
> +++ b/src/virt-viewer-window.c
> @@ -206,7 +206,7 @@ rebuild_combo_menu(GObject    *gobject G_GNUC_UNUSED,
>      menu = GTK_WIDGET(gtk_builder_get_object(self->priv->builder, "menu-send"));
>      gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu),
>                                GTK_WIDGET(virt_viewer_window_get_keycombo_menu(self)));
> -    gtk_widget_set_sensitive(menu, FALSE);
> +    gtk_widget_set_sensitive(menu, (self->priv->display != NULL));
>  }
>
>  static void
> @@ -1268,9 +1268,7 @@ display_show_hint(VirtViewerDisplay *display,
>
>      hint = (hint & VIRT_VIEWER_DISPLAY_SHOW_HINT_READY);
>
> -    gtk_widget_set_sensitive(GTK_WIDGET(gtk_builder_get_object(self->priv->builder, "menu-send")), hint);
>      gtk_widget_set_sensitive(GTK_WIDGET(gtk_builder_get_object(self->priv->builder, "menu-file-screenshot")), hint);
> -    gtk_widget_set_sensitive(self->priv->toolbar_send_key, hint);
>  }
>  static gboolean
>  window_key_pressed (GtkWidget *widget G_GNUC_UNUSED,
> @@ -1329,6 +1327,9 @@ virt_viewer_window_set_display(VirtViewerWindow *self, VirtViewerDisplay *displa
>                                            G_CALLBACK(display_show_hint), self, 0);
>          if (virt_viewer_display_get_enabled(display))
>              virt_viewer_window_desktop_resize(display, self);
> +
> +        gtk_widget_set_sensitive(GTK_WIDGET(gtk_builder_get_object(self->priv->builder, "menu-send")), TRUE);
> +        gtk_widget_set_sensitive(self->priv->toolbar_send_key, TRUE);
>      }
>  }
>
> --
> 1.9.3
>
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list

The patch doesn't apply on git master. Can you rebase it and resend to ML?

Best Regards,
-- 
Fabiano Fidêncio




More information about the virt-tools-list mailing list