Permalink
Browse files

When fetching properties as strings, handle single valued cardinals too

2009-02-13  Ross Burton  <ross@linux.intel.com>

	* src/xutils.c:
	When fetching properties as strings, handle single valued
	cardinals too (thanks Keith Swett).

svn path=/trunk/; revision=215
  • Loading branch information...
1 parent f542937 commit 742a57a9af09d27410de8339c16696096721c62b @rossburton rossburton committed with Ross Burton Feb 13, 2009
Showing with 21 additions and 0 deletions.
  1. +6 −0 ChangeLog
  2. +15 −0 src/xutils.c
View
@@ -1,3 +1,9 @@
+2009-02-13 Ross Burton <ross@linux.intel.com>
+
+ * src/xutils.c:
+ When fetching properties as strings, handle single valued
+ cardinals too (thanks Keith Swett).
+
2008-04-21 Ross Burton <ross@burtonini.com>
* configure.ac:
View
@@ -167,6 +167,21 @@ my_wnck_get_string_property_latin1 (Window xwindow,
g_free (prop_names);
}
}
+ else if (type == XA_CARDINAL && nitems == 1)
+ {
+ switch(format)
+ {
+ case 32:
+ retval = g_strdup_printf("%lu",*(unsigned long*)property);
+ break;
+ case 16:
+ retval = g_strdup_printf("%u",*(unsigned int*)property);
+ break;
+ case 8:
+ retval = g_strdup_printf("%c",*(unsigned char*)property);
+ break;
+ }
+ }
XFree (property);
return retval;

0 comments on commit 742a57a

Please sign in to comment.