boolean xf_GetWorkArea(xfInfo* xfi) { long* plong; boolean status; unsigned long nitems; unsigned long bytes; unsigned char* prop; status = xf_GetWindowProperty(xfi, DefaultRootWindow(xfi->display), xfi->_NET_WORKAREA, 32 * 4, &nitems, &bytes, &prop); if (status != True) return False; status = xf_GetCurrentDesktop(xfi); if (status != True) return False; plong = (long*) prop; xfi->workArea.x = plong[xfi->current_desktop * 4 + 0]; xfi->workArea.y = plong[xfi->current_desktop * 4 + 1]; xfi->workArea.width = plong[xfi->current_desktop * 4 + 2]; xfi->workArea.height = plong[xfi->current_desktop * 4 + 3]; xfree(prop); return True; }
BOOL xf_GetWorkArea(xfContext* xfc) { long* plong; BOOL status; unsigned long nitems; unsigned long bytes; unsigned char* prop; status = xf_GetCurrentDesktop(xfc); if (!status) return FALSE; status = xf_GetWindowProperty(xfc, DefaultRootWindow(xfc->display), xfc->_NET_WORKAREA, 32 * 4, &nitems, &bytes, &prop); if (!status) return FALSE; if ((xfc->current_desktop * 4 + 3) >= (INT64)nitems) { free(prop); return FALSE; } plong = (long*) prop; xfc->workArea.x = plong[xfc->current_desktop * 4 + 0]; xfc->workArea.y = plong[xfc->current_desktop * 4 + 1]; xfc->workArea.width = plong[xfc->current_desktop * 4 + 2]; xfc->workArea.height = plong[xfc->current_desktop * 4 + 3]; free(prop); return TRUE; }