How to get top-level window position relative to root window (i.e. whole screen) using plain ol' xlib (or brand new XCB)?
+2
A:
Use XTranslateCoordinates (or xcb equivalent) to translate 0,0 on the window to root window coordinates.
Havoc P
2010-09-27 19:56:44
A:
Using Xlib:
XWindowAttributes xwa;
XGetWindowAttributes(display, window, &xwa);
printf("%d %d\n", xwa.x, xwa.y);
There are also lots of other informations that come with XWindowAttributes
. See here.
André Wagner
2010-10-23 15:56:02