src: update action sensitivity when creating window

If we don't explicitly set action sensitivity after associating a
display with the window, the actions will end up with the wrong
state. This exhibits itself as send key actions being marked
disabled despite being connected,

Related: https://gitlab.com/virt-viewer/virt-viewer/-/issues/37
Closes: https://gitlab.com/virt-viewer/virt-viewer/-/issues/41
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2021-05-20 12:50:13 +01:00
parent 4820d05c82
commit aa6b4b40b8

View File

@ -1231,6 +1231,8 @@ ensure_window_for_display(VirtViewerApp *self, VirtViewerDisplay *display)
g_object_set_data(G_OBJECT(display), "virt-viewer-window", win);
g_object_weak_ref(G_OBJECT(win), window_weak_notify, display);
}
virt_viewer_window_set_actions_sensitive(win, priv->connected);
}
virt_viewer_app_set_window_subtitle(self, win, nth);