summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/xprops.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/xprops.c b/src/core/xprops.c
index f9b4578a..82d28046 100644
--- a/src/core/xprops.c
+++ b/src/core/xprops.c
@@ -264,6 +264,16 @@ cardinal_list_from_results (GetPropertyResults *results,
*n_cardinals_p = results->n_items;
results->prop = NULL;
+#if GLIB_SIZEOF_LONG == 8
+ /* Xlib sign-extends format=32 items, but we want them unsigned */
+ {
+ int i;
+
+ for (i = 0; i < *n_cardinals_p; i++)
+ (*cardinals_p)[i] = (*cardinals_p)[i] & 0xffffffff;
+ }
+#endif
+
return TRUE;
}
@@ -608,6 +618,10 @@ cardinal_with_atom_type_from_results (GetPropertyResults *results,
return FALSE;
*cardinal_p = *(gulong*) results->prop;
+#if GLIB_SIZEOF_LONG == 8
+ /* Xlib sign-extends format=32 items, but we want them unsigned */
+ *cardinal_p &= 0xffffffff;
+#endif
XFree (results->prop);
results->prop = NULL;