From ebdcd27f1569045a2e608d71c12b1dbca1b0d3d1 Mon Sep 17 00:00:00 2001 From: Elliot Lee Date: Fri, 28 Nov 1997 03:10:25 +0000 Subject: [PATCH] Fixed a bug in gdk_property_get, I think, and made error messages sane --- gdk/gdkproperty.c | 11 +++++++++-- gdk/x11/gdkproperty-x11.c | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/gdk/gdkproperty.c b/gdk/gdkproperty.c index 35d8a50cf..64cb51314 100644 --- a/gdk/gdkproperty.c +++ b/gdk/gdkproperty.c @@ -95,17 +95,24 @@ gdk_property_get (GdkWindow *window, &ret_nitems, &ret_bytes_after, &ret_data); - if ((ret_prop_type == None) && (ret_format == 0)) + if ((ret_prop_type == None) && (ret_format == 0)) { + g_warning("XGetWindowProperty failed\n"); return FALSE; + } if (actual_property_type) *actual_property_type = ret_prop_type; if (actual_format_type) *actual_format_type = ret_format; - if (ret_prop_type != property) + if (ret_prop_type != type) { + gchar *rn, *pn; XFree (ret_data); + rn = gdk_atom_name(ret_prop_type); + pn = gdk_atom_name(type); + g_warning("Couldn't match property type %s to %s\n", rn, pn); + g_free(rn); g_free(pn); return FALSE; } diff --git a/gdk/x11/gdkproperty-x11.c b/gdk/x11/gdkproperty-x11.c index 35d8a50cf..64cb51314 100644 --- a/gdk/x11/gdkproperty-x11.c +++ b/gdk/x11/gdkproperty-x11.c @@ -95,17 +95,24 @@ gdk_property_get (GdkWindow *window, &ret_nitems, &ret_bytes_after, &ret_data); - if ((ret_prop_type == None) && (ret_format == 0)) + if ((ret_prop_type == None) && (ret_format == 0)) { + g_warning("XGetWindowProperty failed\n"); return FALSE; + } if (actual_property_type) *actual_property_type = ret_prop_type; if (actual_format_type) *actual_format_type = ret_format; - if (ret_prop_type != property) + if (ret_prop_type != type) { + gchar *rn, *pn; XFree (ret_data); + rn = gdk_atom_name(ret_prop_type); + pn = gdk_atom_name(type); + g_warning("Couldn't match property type %s to %s\n", rn, pn); + g_free(rn); g_free(pn); return FALSE; }