[virt-tools-list] [PATCH v3 3/5] Port to GtkApplication API's

Eduardo Lima (Etrunko) etrunko at redhat.com
Fri Feb 12 17:26:11 UTC 2016


On 02/12/2016 10:09 AM, Eduardo Lima (Etrunko) wrote:
> Running remote-viewer will throw some warnings:
> 
> (remote-viewer:546): Gtk-CRITICAL **: gtk_application_get_app_menu:
> assertion 'GTK_IS_APPLICATION (application)' failed
> 
> (remote-viewer:546): Gtk-CRITICAL **: gtk_application_get_menubar:
> assertion 'GTK_IS_APPLICATION (application)' failed
> 
> This does not happen with virt-viewer. I attached the gdb backtrace to
> this mail.
> 

Fidencio just pointed out that these warnings won't happen with recent
versions of glib/gtk as for instance the ones shipped with fedora, and I
can confirm it. Also, I have some minor additions to this patch that I
just added:

diff --git a/src/remote-viewer.c b/src/remote-viewer.c
index 1c3cd84..93aa590 100644
--- a/src/remote-viewer.c
+++ b/src/remote-viewer.c
@@ -754,7 +754,7 @@ authenticate_cb(RestProxy *proxy, G_GNUC_UNUSED
RestProxyAuth *auth,
 }

 static void
-ovirt_foreign_menu_update(GtkApplication *gtkapp, GtkWindow *gtkwin,
gpointer data)
+ovirt_foreign_menu_update(GtkApplication *gtkapp, GtkWindow *gtkwin,
G_GNUC_UNUSED gpointer data)
 {
     RemoteViewer *app = REMOTE_VIEWER(gtkapp);
     VirtViewerWindow *win = g_object_get_data(G_OBJECT(gtkwin),
"virt-viewer-window");
diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index 5b0e720..fca483a 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -1892,6 +1892,7 @@ virt_viewer_app_local_command_line (GApplication
 *gapp,
     GOptionContext *context = g_option_context_new(NULL);
     GOptionGroup *group = g_option_group_new("virt-viewer", NULL, NULL,
NULL, NULL);

+    *status = 0;
     g_option_context_set_main_group(context, group);
     VIRT_VIEWER_APP_GET_CLASS(self)->add_option_entries(self, context,
group);


-- 
Eduardo de Barros Lima (Etrunko)
Software Engineer - RedHat
etrunko at redhat.com




More information about the virt-tools-list mailing list