diff --git a/ewmhints.c b/ewmhints.c index 5453c4f..edcc108 100644 --- a/ewmhints.c +++ b/ewmhints.c @@ -90,11 +90,11 @@ static int get_current_desktop(void) { unsigned long nitems_return; - uint32 *prop_return; + unsigned char *prop_return; int current_desktop; if (get_property_value("_NET_CURRENT_DESKTOP", 1, &nitems_return, - (unsigned char **) &prop_return) < 0) + &prop_return) < 0) return (-1); if (nitems_return != 1) @@ -118,7 +118,8 @@ get_current_workarea(uint32 * x, uint32 * y, uint32 * width, uint32 * height) { int current_desktop; unsigned long nitems_return; - uint32 *prop_return; + unsigned char *prop_return; + uint32 *return_words; const uint32 net_workarea_x_offset = 0; const uint32 net_workarea_y_offset = 1; const uint32 net_workarea_width_offset = 2; @@ -126,7 +127,7 @@ get_current_workarea(uint32 * x, uint32 * y, uint32 * width, uint32 * height) const uint32 max_prop_length = 32 * 4; /* Max 32 desktops */ if (get_property_value("_NET_WORKAREA", max_prop_length, &nitems_return, - (unsigned char **) &prop_return) < 0) + &prop_return) < 0) return (-1); if (nitems_return % 4) @@ -140,10 +141,12 @@ get_current_workarea(uint32 * x, uint32 * y, uint32 * width, uint32 * height) if (current_desktop < 0) return -1; - *x = prop_return[current_desktop * 4 + net_workarea_x_offset]; - *y = prop_return[current_desktop * 4 + net_workarea_y_offset]; - *width = prop_return[current_desktop * 4 + net_workarea_width_offset]; - *height = prop_return[current_desktop * 4 + net_workarea_height_offset]; + return_words = (uint32 *)prop_return; + + *x = return_words[current_desktop * 4 + net_workarea_x_offset]; + *y = return_words[current_desktop * 4 + net_workarea_y_offset]; + *width = return_words[current_desktop * 4 + net_workarea_width_offset]; + *height = return_words[current_desktop * 4 + net_workarea_height_offset]; XFree(prop_return);