[virt-tools-list] [virt-viewer 1/2] vnc: Clear all displays before creating dummy display

Christophe Fergeau cfergeau at redhat.com
Tue Oct 15 15:20:12 UTC 2013


If VirtViewerSessionVnc::disconnected is called because of an
authentication failure, we get:
(remote-viewer:29588): gtk-vnc-DEBUG: vncdisplay.c Disconnected from VNC server

(remote-viewer:29588): Gtk-WARNING **: Attempting to add a widget with type
VncDisplay to a container of type VirtViewerDisplayVnc, but the widget is
already inside a container of type VirtViewerDisplayVnc, please use
gtk_widget_reparent()

Program received signal SIGTRAP, Trace/breakpoint trap.
0x0000003136e50499 in g_logv (log_domain=0x3f2e13e143 "Gtk", log_level=G_LOG_LEVEL_WARNING, format=<optimized out>,
    args=args at entry=0x7fffffffd250) at gmessages.c:989
989                     G_BREAKPOINT ();
Missing separate debuginfos, use: debuginfo-install ibus-gtk3-1.5.4-2.fc20.x86_64 ibus-libs-1.5.4-2.fc20.x86_64
(gdb) bt
    args=args at entry=0x7fffffffd250) at gmessages.c:989
    instance=instance at entry=0x8aa260, args=args at entry=0x7fffffffd570, n_params=0, param_types=0x0) at gclosure.c:840
    var_args=var_args at entry=0x7fffffffd570) at gsignal.c:3238
    at gsignal.c:3386
    instance=instance at entry=0x8b7aa0, args=args at entry=0x7fffffffd840, n_params=0, param_types=0x0) at gclosure.c:840
    var_args=var_args at entry=0x7fffffffd840) at gsignal.c:3238
    at gsignal.c:3386
    self=<optimized out>) at gmain.c:3712

This commit calls virt_viewer_session_clear_displays() before creating a dummy VNC display with
virt_viewer_display_vnc_new(), which avoids this warning.
---
 src/virt-viewer-session-vnc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/virt-viewer-session-vnc.c b/src/virt-viewer-session-vnc.c
index 05e98c8..d5d0631 100644
--- a/src/virt-viewer-session-vnc.c
+++ b/src/virt-viewer-session-vnc.c
@@ -110,7 +110,11 @@ static void
 virt_viewer_session_vnc_disconnected(VncDisplay *vnc G_GNUC_UNUSED,
                                      VirtViewerSessionVnc *session)
 {
-    GtkWidget *display = virt_viewer_display_vnc_new(session->priv->vnc);
+    GtkWidget *display;
+    if (session->priv->vnc != NULL) {
+        virt_viewer_session_clear_displays(VIRT_VIEWER_SESSION(session));
+    }
+    display = virt_viewer_display_vnc_new(session->priv->vnc);
     DEBUG_LOG("Disconnected");
     g_signal_emit_by_name(session, "session-disconnected");
     virt_viewer_display_set_show_hint(VIRT_VIEWER_DISPLAY(display),
-- 
1.8.3.1




More information about the virt-tools-list mailing list