From a07277f28b924bb6cab87d4b24136e8b8ee9d883 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 28 Mar 2013 22:24:41 +0100 Subject: [PATCH] virt-viewer-app: Always allow users to close displays from the displays menu Marking display menu items as non sensitive for shown displays make no sense, since the user can always close them through the window-manager. Having a window for a display shown when the display is not selectable nor ready, can happen when the agent goes away. This happens for example when using a dual monitor config with a Linux guest and then switching to a text console inside the guest. Signed-off-by: Hans de Goede --- src/virt-viewer-app.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c index a05941b..3fd7613 100644 --- a/src/virt-viewer-app.c +++ b/src/virt-viewer-app.c @@ -1822,7 +1822,7 @@ window_update_menu_displays_cb(gpointer key G_GNUC_UNUSED, VirtViewerWindow *vwin = VIRT_VIEWER_WINDOW(g_hash_table_lookup(self->priv->windows, nth)); VirtViewerDisplay *display = virt_viewer_window_get_display(vwin); GtkWidget *item; - gboolean visible, sensitive = FALSE; + gboolean visible, sensitive; gchar *label; label = g_strdup_printf(_("Display %d"), *nth + 1); @@ -1832,6 +1832,7 @@ window_update_menu_displays_cb(gpointer key G_GNUC_UNUSED, visible = gtk_widget_get_visible(GTK_WIDGET(virt_viewer_window_get_window(vwin))); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), visible); + sensitive = visible; if (display) { guint hint = virt_viewer_display_get_show_hint(display); @@ -1841,7 +1842,6 @@ window_update_menu_displays_cb(gpointer key G_GNUC_UNUSED, if (virt_viewer_display_get_selectable(display)) sensitive = TRUE; } - gtk_widget_set_sensitive(item, sensitive); g_signal_connect(G_OBJECT(item),