All pastes #249392 Raw Edit

Stuff

public c v1 · immutable
#249392 ·published 2006-11-15 19:02 UTC
rendered paste body
static unsigned intget_opacity_prop(Display *dpy, win *w, unsigned int def){    Atom actual;    int format;    unsigned long n, left;    unsigned char *data;    int result = XGetWindowProperty(dpy, w->id, opacityAtom, 0L, 1L, False, 		       XA_CARDINAL, &actual, &format, 				    &n, &left, &data);    if (result == Success && data != NULL)    {	unsigned int i;	memcpy (&i, data, sizeof (unsigned int));	XFree( (void *) data);	return i;    }    return def;}/* Get the opacity property from the window in a percent format   not found: default   otherwise: the value*/static doubleget_opacity_percent(Display *dpy, win *w, double def){    unsigned int opacity = get_opacity_prop (dpy, w, (unsigned int)(OPAQUE*def));    return opacity*1.0/OPAQUE;}