|
|
1efd99 |
From 98de755b5be6e76570782755ff026061310bec19 Mon Sep 17 00:00:00 2001
|
|
|
1efd99 |
From: Victor Toso <me@victortoso.com>
|
|
|
1efd99 |
Date: Tue, 6 Jun 2017 14:05:32 +0200
|
|
|
1efd99 |
Subject: [PATCH] vnc: do not show error on cancel/close of auth dialog
|
|
|
1efd99 |
|
|
|
1efd99 |
Mainly a kiosk mode issue, similar to the spice fix in 6480e52f62b.
|
|
|
1efd99 |
|
|
|
1efd99 |
This patch saves the cancel/close state of auth dialog from
|
|
|
1efd99 |
virt_viewer_auth_collect_credentials() in order to avoid an error
|
|
|
1efd99 |
dialog to pop up to user in kiosk mode.
|
|
|
1efd99 |
|
|
|
1efd99 |
This happens due the fact that we call virt_viewer_app_disconnected()
|
|
|
1efd99 |
twice:
|
|
|
1efd99 |
- One with "session-cancelled" which is correct and well handled;
|
|
|
1efd99 |
- The other with "session-disconnected" which is misleading as there
|
|
|
1efd99 |
was no connection at this time. This will trigger the error dialog
|
|
|
1efd99 |
with "Unable to connect to the graphic server %s".
|
|
|
1efd99 |
|
|
|
1efd99 |
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1446161
|
|
|
1efd99 |
|
|
|
1efd99 |
Signed-off-by: Victor Toso <victortoso@redhat.com>
|
|
|
1efd99 |
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
|
|
|
1efd99 |
(cherry picked from commit fb14a8b300ed89a40938302a37679f902b3dab40)
|
|
|
1efd99 |
---
|
|
|
1efd99 |
src/virt-viewer-session-vnc.c | 6 ++++++
|
|
|
1efd99 |
1 file changed, 6 insertions(+)
|
|
|
1efd99 |
|
|
|
1efd99 |
diff --git a/src/virt-viewer-session-vnc.c b/src/virt-viewer-session-vnc.c
|
|
|
1efd99 |
index 26fb405..c79b63c 100644
|
|
|
1efd99 |
--- a/src/virt-viewer-session-vnc.c
|
|
|
1efd99 |
+++ b/src/virt-viewer-session-vnc.c
|
|
|
1efd99 |
@@ -40,6 +40,7 @@ struct _VirtViewerSessionVncPrivate {
|
|
|
1efd99 |
GtkWindow *main_window;
|
|
|
1efd99 |
/* XXX we should really just have a VncConnection */
|
|
|
1efd99 |
VncDisplay *vnc;
|
|
|
1efd99 |
+ gboolean auth_dialog_cancelled;
|
|
|
1efd99 |
};
|
|
|
1efd99 |
|
|
|
1efd99 |
#define VIRT_VIEWER_SESSION_VNC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), VIRT_VIEWER_TYPE_SESSION_VNC, VirtViewerSessionVncPrivate))
|
|
|
1efd99 |
@@ -104,6 +105,8 @@ virt_viewer_session_vnc_connected(VncDisplay *vnc G_GNUC_UNUSED,
|
|
|
1efd99 |
GtkWidget *display = virt_viewer_display_vnc_new(session, session->priv->vnc);
|
|
|
1efd99 |
VirtViewerApp *app = virt_viewer_session_get_app(VIRT_VIEWER_SESSION(session));
|
|
|
1efd99 |
|
|
|
1efd99 |
+ session->priv->auth_dialog_cancelled = FALSE;
|
|
|
1efd99 |
+
|
|
|
1efd99 |
virt_viewer_window_set_display(virt_viewer_app_get_main_window(app),
|
|
|
1efd99 |
VIRT_VIEWER_DISPLAY(display));
|
|
|
1efd99 |
|
|
|
1efd99 |
@@ -117,6 +120,8 @@ virt_viewer_session_vnc_disconnected(VncDisplay *vnc G_GNUC_UNUSED,
|
|
|
1efd99 |
VirtViewerSessionVnc *session)
|
|
|
1efd99 |
{
|
|
|
1efd99 |
GtkWidget *display;
|
|
|
1efd99 |
+ if (session->priv->auth_dialog_cancelled)
|
|
|
1efd99 |
+ return;
|
|
|
1efd99 |
|
|
|
1efd99 |
virt_viewer_session_clear_displays(VIRT_VIEWER_SESSION(session));
|
|
|
1efd99 |
display = virt_viewer_display_vnc_new(session, session->priv->vnc);
|
|
|
1efd99 |
@@ -314,6 +319,7 @@ virt_viewer_session_vnc_auth_credential(GtkWidget *src G_GNUC_UNUSED,
|
|
|
1efd99 |
|
|
|
1efd99 |
if (!ret) {
|
|
|
1efd99 |
vnc_display_close(self->priv->vnc);
|
|
|
1efd99 |
+ self->priv->auth_dialog_cancelled = TRUE;
|
|
|
1efd99 |
g_signal_emit_by_name(self, "session-cancelled");
|
|
|
1efd99 |
goto cleanup;
|
|
|
1efd99 |
}
|
|
|
1efd99 |
--
|
|
|
1efd99 |
2.13.0
|
|
|
1efd99 |
|