teuf pushed to spice-gtk (f21). "Fix various runtime warnings"

notifications at fedoraproject.org notifications at fedoraproject.org
Thu Apr 2 14:19:25 UTC 2015


>From 043995d2b9941ad67f9c0aa637bc0339b030b462 Mon Sep 17 00:00:00 2001
From: Christophe Fergeau <cfergeau at redhat.com>
Date: Thu, 2 Apr 2015 16:16:21 +0200
Subject: Fix various runtime warnings


diff --git a/0012-spice-widget-Don-t-return-early-from-focus_in_event-.patch b/0012-spice-widget-Don-t-return-early-from-focus_in_event-.patch
new file mode 100644
index 0000000..20b15a9
--- /dev/null
+++ b/0012-spice-widget-Don-t-return-early-from-focus_in_event-.patch
@@ -0,0 +1,38 @@
+From 4c4d7b20822a8ae916df902dd8218cadfe6f0a17 Mon Sep 17 00:00:00 2001
+From: Pavel Grunt <pgrunt at redhat.com>
+Date: Fri, 23 Jan 2015 17:35:02 +0100
+Subject: [spice-gtk] spice-widget: Don't return early from focus_in_event when
+ widget is not realized
+
+Otherwise SpiceDisplay might not get the keyboard grab.
+It also silence GSpice-CRITICAL on focus out event:
+GSpice-CRITICAL **: spice_gtk_session_request_auto_usbredir: assertion 's->auto_usbredir_reqs > 0' failed
+---
+ gtk/spice-widget.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
+index 3a2be87..147271c 100644
+--- a/gtk/spice-widget.c
++++ b/gtk/spice-widget.c
+@@ -1475,9 +1475,6 @@ static gboolean focus_in_event(GtkWidget *widget, GdkEventFocus *focus G_GNUC_UN
+ 
+     SPICE_DEBUG("%s", __FUNCTION__);
+ 
+-    if (!gtk_widget_get_realized(widget))
+-        return true;
+-
+     /*
+      * Ignore focus in when we already have the focus
+      * (this happens when doing an ungrab from the leave_event callback).
+@@ -1492,7 +1489,9 @@ static gboolean focus_in_event(GtkWidget *widget, GdkEventFocus *focus G_GNUC_UN
+         memset(d->activeseq, 0, sizeof(gboolean) * d->grabseq->nkeysyms);
+     update_keyboard_focus(display, true);
+     try_keyboard_grab(display);
+-    update_display(display);
++
++    if (gtk_widget_get_realized(widget))
++        update_display(display);
+ 
+     return true;
+ }
diff --git a/0013-desktop-integration-check-owner-of-bus-name.patch b/0013-desktop-integration-check-owner-of-bus-name.patch
new file mode 100644
index 0000000..1dae4ed
--- /dev/null
+++ b/0013-desktop-integration-check-owner-of-bus-name.patch
@@ -0,0 +1,39 @@
+From 6e86378ec9de4ca1610e1a47a099e8f772cdb3b5 Mon Sep 17 00:00:00 2001
+From: Pavel Grunt <pgrunt at redhat.com>
+Date: Wed, 28 Jan 2015 12:47:32 +0100
+Subject: [spice-gtk] desktop-integration: check owner of bus name
+
+It avoids calling D-Bus methods when the bus name
+"org.gnome.SessionManager" does not exist.
+
+Silences:
+GSpice-WARNING **: Error calling 'org.gnome.SessionManager.Inhibit': GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files
+---
+ gtk/desktop-integration.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/gtk/desktop-integration.c b/gtk/desktop-integration.c
+index c366fd0..5868d48 100644
+--- a/gtk/desktop-integration.c
++++ b/gtk/desktop-integration.c
+@@ -67,6 +67,7 @@ static gboolean gnome_integration_init(SpiceDesktopIntegration *self)
+     gboolean success = TRUE;
+ 
+ #if defined(USE_GDBUS)
++    gchar *name_owner = NULL;
+     priv->gnome_session_proxy =
+         g_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SESSION,
+                                       G_DBUS_PROXY_FLAGS_NONE,
+@@ -76,6 +77,12 @@ static gboolean gnome_integration_init(SpiceDesktopIntegration *self)
+                                       "org.gnome.SessionManager",
+                                       NULL,
+                                       &error);
++    if (!error &&
++        (name_owner = g_dbus_proxy_get_name_owner(priv->gnome_session_proxy)) == NULL) {
++        g_clear_object(&priv->gnome_session_proxy);
++        success = FALSE;
++    }
++    g_free(name_owner);
+ #else
+     success = FALSE;
+ #endif
diff --git a/0014-widget-Do-not-draw-cursor-if-widget-is-not-realized.patch b/0014-widget-Do-not-draw-cursor-if-widget-is-not-realized.patch
new file mode 100644
index 0000000..024233b
--- /dev/null
+++ b/0014-widget-Do-not-draw-cursor-if-widget-is-not-realized.patch
@@ -0,0 +1,25 @@
+From 456e3e7519373e350fd94373b3c98ad51f3e71a4 Mon Sep 17 00:00:00 2001
+From: Pavel Grunt <pgrunt at redhat.com>
+Date: Sun, 15 Feb 2015 19:42:13 +0100
+Subject: [spice-gtk] widget: Do not draw cursor if widget is not realized
+
+Silences the runtime warning in virt-viewer and gnome-boxes (bgo#744432):
+Gtk-CRITICAL **: gtk_widget_queue_draw_area: assertion 'width >= 0' failed
+---
+ gtk/spice-widget.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
+index 1f7008a..f5e8aab 100644
+--- a/gtk/spice-widget.c
++++ b/gtk/spice-widget.c
+@@ -2341,6 +2341,9 @@ static void cursor_invalidate(SpiceDisplay *display)
+     double s;
+     int x, y;
+ 
++    if (!gtk_widget_get_realized (GTK_WIDGET(display)))
++        return;
++
+     if (d->mouse_pixbuf == NULL)
+         return;
+ 
diff --git a/spice-gtk.spec b/spice-gtk.spec
index 4c9ebad..d68af3f 100644
--- a/spice-gtk.spec
+++ b/spice-gtk.spec
@@ -26,6 +26,9 @@ Patch0008:      0008-channel-delay-event-report-to-after-coroutine-exit.patch
 Patch0009:      0009-channel-reset-tls-state-when-client-calls-connect.patch
 Patch0010:      0010-channel-reset-connection-state-on-error.patch
 Patch0011:      0011-channel-usbredir-Do-not-stop-event-listening-if-Spic.patch
+Patch0012:      0012-spice-widget-Don-t-return-early-from-focus_in_event-.patch
+Patch0013:      0013-desktop-integration-check-owner-of-bus-name.patch
+Patch0014:      0014-widget-Do-not-draw-cursor-if-widget-is-not-realized.patch
 
 BuildRequires: intltool
 BuildRequires: gtk2-devel >= 2.14
@@ -167,6 +170,9 @@ find . -name '*.stamp' | xargs touch
 %patch0009 -p1
 %patch0010 -p1
 %patch0011 -p1
+%patch0012 -p1
+%patch0013 -p1
+%patch0014 -p1
 popd
 
 %if %{with_gtk3}
@@ -291,6 +297,8 @@ rm -rf %{buildroot}%{_datadir}/pkgconfig/spice-protocol.pc
 * Thu Apr 02 2015 Christophe Fergeau <cfergeau at redhat.com> 0.27-6
 - Add patch fixing USB redirection related race/crash
   Resolves: rhbz#1182226
+- Fix various runtime warnings
+  Resolves: rhbz#1175721
 
 * Tue Jan 27 2015 Marc-André Lureau <marcandre.lureau at redhat.com> 0.27-5
 - Fix reconnection on same session regressions introduced in 27-2.
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/spice-gtk.git/commit/?h=f21&id=043995d2b9941ad67f9c0aa637bc0339b030b462


More information about the scm-commits mailing list