rpms/libwnck/devel no-resource-extension.patch, NONE, 1.1 libwnck.spec, 1.85, 1.86

Matthias Clasen (mclasen) fedora-extras-commits at redhat.com
Mon Oct 22 16:57:48 UTC 2007


Author: mclasen

Update of /cvs/extras/rpms/libwnck/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv24665

Modified Files:
	libwnck.spec 
Added Files:
	no-resource-extension.patch 
Log Message:
don't crash gnome-system-monitor if the X Resource extension is missing


no-resource-extension.patch:

--- NEW FILE no-resource-extension.patch ---
diff -up libwnck-2.20.1/libwnck/util.c.no-resource-extension libwnck-2.20.1/libwnck/util.c
--- libwnck-2.20.1/libwnck/util.c.no-resource-extension	2007-10-22 12:36:51.000000000 -0400
+++ libwnck-2.20.1/libwnck/util.c	2007-10-22 12:36:55.000000000 -0400
@@ -114,32 +114,13 @@ _wnck_print_resource_usage (WnckResource
 }
 #endif
 
-/**
- * wnck_xid_read_resource_usage:
- * @gdk_display: a <classname>GdkDisplay</classname>.
- * @xid: an X window ID.
- * @usage: return location for the X resource usage of the application owning
- * the X window ID @xid.
- *
- * Looks for the X resource usage of the application owning the X window ID
- * @xid on display @gdisplay. If no resource usage can be found, then all
- * fields of @usage are set to 0.
- *
- * To properly work, this function requires the XRes extension on the X server.
- *
- * Since: 2.6
- */
-void
-wnck_xid_read_resource_usage (GdkDisplay        *gdisplay,
-                              gulong             xid,
-                              WnckResourceUsage *usage)
+static WnckExtStatus
+wnck_init_resource_usage (GdkDisplay *gdisplay)
 {
   int event, error;
   Display *xdisplay;
   WnckExtStatus status;
 
-  g_return_if_fail (usage != NULL);
-
   xdisplay = GDK_DISPLAY_XDISPLAY (gdisplay);
 
   status = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (gdisplay),
@@ -163,13 +144,37 @@ wnck_xid_read_resource_usage (GdkDisplay
 
   g_assert (status != WNCK_EXT_UNKNOWN);
 
-  memset (usage, '\0', sizeof (*usage));
-  
-  if (status == WNCK_EXT_MISSING)
+  return status;
+}
+
+/**
+ * wnck_xid_read_resource_usage:
+ * @gdk_display: a <classname>GdkDisplay</classname>.
+ * @xid: an X window ID.
+ * @usage: return location for the X resource usage of the application owning
+ * the X window ID @xid.
+ *
+ * Looks for the X resource usage of the application owning the X window ID
+ * @xid on display @gdisplay. If no resource usage can be found, then all
+ * fields of @usage are set to 0.
+ *
+ * To properly work, this function requires the XRes extension on the X server.
+ *
+ * Since: 2.6
+ */
+void
+wnck_xid_read_resource_usage (GdkDisplay        *gdisplay,
+                              gulong             xid,
+                              WnckResourceUsage *usage)
+{
+  g_return_if_fail (usage != NULL);
+
+  if (wnck_init_resource_usage (gdisplay) == WNCK_EXT_MISSING)
     return;
 
 #ifdef HAVE_XRES
  {
+   Display *xdisplay;
    XResType *types;
    int n_types;
    unsigned long pixmap_bytes;
@@ -608,12 +613,12 @@ wnck_pid_read_resource_usage (GdkDisplay
 {
   g_return_if_fail (usage != NULL);
 
-#ifndef HAVE_XRES
-  memset (usage, '\0', sizeof (*usage));
-  return;
-#else
   memset (usage, '\0', sizeof (*usage));
 
+  if (wnck_init_resource_usage (gdisplay) == WNCK_EXT_MISSING)
+    return;
+
+#ifdef HAVE_XRES
   if (!wnck_pid_read_resource_usage_from_cache (gdisplay, pid, usage))
     /* the cache might not be built, might be outdated or might not contain
      * data for a new X client, so try to fallback to something else */


Index: libwnck.spec
===================================================================
RCS file: /cvs/extras/rpms/libwnck/devel/libwnck.spec,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -r1.85 -r1.86
--- libwnck.spec	16 Oct 2007 02:08:54 -0000	1.85
+++ libwnck.spec	22 Oct 2007 16:57:12 -0000	1.86
@@ -6,7 +6,7 @@
 Summary: Window Navigator Construction Kit
 Name: libwnck
 Version: 2.20.1
-Release: 1%{?dist}
+Release: 2%{?dist}
 URL: http://download.gnome.org/sources/libwnck/
 Source0: http://download.gnome.org/sources/libwnck/2.20/%{name}-%{version}.tar.bz2
 License: LGPLv2+
@@ -27,10 +27,12 @@
 BuildRequires:  gettext
 
 # http://bugzilla.gnome.org/show_bug.cgi?id=352383
-Patch3: libwnck-2.19.4-appearance.patch
-Patch5: libwnck-2.18.0-above.patch
+Patch0: libwnck-2.19.4-appearance.patch
+Patch1: libwnck-2.18.0-above.patch
 # http://bugzilla.gnome.org/show_bug.cgi?id=459984
-Patch6: crash-on-shutdown.patch
+Patch2: crash-on-shutdown.patch
+# http://bugzilla.gnome.org/show_bug.cgi?id=489087
+Patch3: no-resource-extension.patch
 
 %description
 
@@ -61,9 +63,10 @@
 
 %prep
 %setup -q
-%patch3 -p1 -b .appearance
-%patch5 -p1 -b .above
-%patch6 -p1 -b .crash-on-shutdown
+%patch0 -p1 -b .appearance
+%patch1 -p1 -b .above
+%patch2 -p1 -b .crash-on-shutdown
+%patch3 -p1 -b .no-resource-extension
 
 %build
 
@@ -100,6 +103,9 @@
 %doc %{_datadir}/gtk-doc/html/libwnck
 
 %changelog
+* Mon Oct 22 2007 Matthias Clasen <mclasen at redhat.com> - 2.20.1-2
+- Don't crash if the X resource extension is missing (#343881)
+
 * Mon Oct 15 2007 Matthias Clasen <mclasen at redhat.com> - 2.20.1-1
 - Update to 2.20.1 (crash fixes, translation updates)
 




More information about the fedora-extras-commits mailing list