Get the window position on SDL/X11

What’s the correct way to find the topleft corner position of a SDL
window? This code returns always (0,0). I’ve also tried with
info.info.x11.window instead of wmwindow and to move the lock function
just before the XMoveWindow() (that works).

SDL_SysWMinfo info;
SDL_VERSION(&info.version);

if ( SDL_GetWMInfo(&info) > 0 ) {
if ( info.subsystem == SDL_SYSWM_X11 ) {
XWindowAttributes attrs;

     info.info.x11.lock_func();

     Status rc = XGetWindowAttributes(info.info.x11.display,
                 info.info.x11.wmwindow, &attrs);

if(rc) {

// at this point attrs.x and attr.y are always ZERO.
[…]

I’ve looked at the SDL X11 driver and it seems that there are at least
two windows opened, but I’m able to get only the offset of
info.info.x11.window, and moving THAT window makes it clip to the window
border instead of the desktop one!

Bye,
Gabry