diff options
| author | Christophe Fergeau <cfergeau@redhat.com> | 2013-10-29 14:30:52 +0100 |
|---|---|---|
| committer | Christophe Fergeau <cfergeau@redhat.com> | 2013-11-13 11:29:05 +0100 |
| commit | 2f890cf2f5faec0d859df3d8ce91a8f9ad7f5dfd (patch) | |
| tree | 73df7351a9b09dfd5b744ac86e04c8c9932a9231 /src | |
| parent | 06b2c382468876a19600374bd59475e66d488af8 (diff) | |
| download | virt-viewer-2f890cf2f5faec0d859df3d8ce91a8f9ad7f5dfd.tar.gz virt-viewer-2f890cf2f5faec0d859df3d8ce91a8f9ad7f5dfd.tar.xz virt-viewer-2f890cf2f5faec0d859df3d8ce91a8f9ad7f5dfd.zip | |
Hide all windows on disconnection
When starting remote-viewer without argument, we are showing a
window where the user can enter connection details. We then
go on to try and connect to the URI the user specified, and if
the connection fails, we disconnect from the remote server, and then
we show again the connection window so that the user can correct the
URI if he entered it wrong.
However, when this happens, the window for the previous connection
will still be visible even if connection failed. To avoid this,
this commit makes sure we hide all windows when we get a disconnection
event.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1024309
Diffstat (limited to 'src')
| -rw-r--r-- | src/virt-viewer-app.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c index bcd8018..c0d3e42 100644 --- a/src/virt-viewer-app.c +++ b/src/virt-viewer-app.c @@ -361,6 +361,19 @@ virt_viewer_app_window_set_visible(VirtViewerApp *self, return FALSE; } +static void hide_one_window(gpointer key G_GNUC_UNUSED, + gpointer value, + gpointer user_data G_GNUC_UNUSED) +{ + virt_viewer_window_hide(VIRT_VIEWER_WINDOW(value)); +} + +static void +virt_viewer_app_hide_all_windows(VirtViewerApp *app) +{ + g_hash_table_foreach(app->priv->windows, hide_one_window, NULL); +} + G_MODULE_EXPORT void virt_viewer_app_about_close(GtkWidget *dialog, VirtViewerApp *self G_GNUC_UNUSED) @@ -1212,6 +1225,7 @@ virt_viewer_app_disconnected(VirtViewerSession *session G_GNUC_UNUSED, VirtViewerAppPrivate *priv = self->priv; gboolean connect_error = !priv->connected && !priv->cancelled; + virt_viewer_app_hide_all_windows(self); if (priv->quitting) gtk_main_quit(); |
