--- sourceforge.net/trunk/rdesktop/ewmhints.c 2003/08/27 22:51:33 450 +++ sourceforge.net/trunk/rdesktop/ewmhints.c 2005/08/03 10:56:16 963 @@ -1,10 +1,10 @@ -/* +/* -*- c-basic-offset: 8 -*- rdesktop: A Remote Desktop Protocol client. Support functions for Extended Window Manager Hints, http://www.freedesktop.org/standards/wm-spec.html - Copyright (C) Matthew Chapman 1999-2002 + Copyright (C) Peter Astrand 2003 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -90,11 +90,10 @@ 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) + if (get_property_value("_NET_CURRENT_DESKTOP", 1, &nitems_return, &prop_return) < 0) return (-1); if (nitems_return != 1) @@ -118,15 +117,15 @@ { 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; const uint32 net_workarea_height_offset = 3; 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) + if (get_property_value("_NET_WORKAREA", max_prop_length, &nitems_return, &prop_return) < 0) return (-1); if (nitems_return % 4) @@ -140,10 +139,12 @@ 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);