Created
November 1, 2011 08:05
-
-
Save chjj/1330126 to your computer and use it in GitHub Desktop.
x frame extents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void | |
get_frame_extents(Display *dpy, Window w, int *top) { | |
long *extents; | |
Atom actual_type; | |
int actual_format; | |
unsigned long nitems, bytes_after; | |
unsigned char *data = NULL; | |
int result; | |
*top = 0; | |
result = XGetWindowProperty( | |
dpy, w, XInternAtom(dpy, "_NET_FRAME_EXTENTS", False), | |
0, 4, False, AnyPropertyType, | |
&actual_type, &actual_format, | |
&nitems, &bytes_after, &data); | |
if (result == Success) { | |
printf("nitems: %u, after: %u\n", nitems, bytes_after); | |
if ((nitems == 4) && (bytes_after == 0)) { | |
extents = (long *)data; | |
*top = (int) *(extents + 2); | |
} | |
XFree(data); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment