Position of a window under xorg

I try to get the window position with the following code :–
if (hSurface)
{
SDL_SysWMinfo info;
Window window, dummy;
int x, y;
XWindowAttributes attributes;
Display *display;

	SDL_VERSION(&info.version);

	if (!SDL_GetWMInfo(&info))
		return (hY);

	info.info.x11.lock_func();
	display = info.info.x11.display;
	window = info.info.x11.window;
	XSync(display, false);
	XGetWindowAttributes(display, window, &attributes);
	XTranslateCoordinates (display, window, attributes.root, 0, 0, &x, &y, 

&dummy);
info.info.x11.unlock_func();
hY = y;
}

But the returned coordinates are x = 4 and y = 22 when the window is located
at 0,0. How can i take care about wm decorators ? Am i doing something
wrong ?

Regards,


jabber : lordheavy at jabber.fr
mail : lordheavymREMOVEME at gmail.com

  display = info.info.x11.display;
  window = info.info.x11.window;

But the returned coordinates are x = 4 and y = 22 when the window is located
at 0,0. How can i take care about wm decorators ? Am i doing something
wrong ?

I think you want wmwindow

-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment

Le Lundi 19 Juin 2006 22:33, Sam Lantinga a ?crit?:

  display = info.info.x11.display;
  window = info.info.x11.window;

But the returned coordinates are x = 4 and y = 22 when the window is
located at 0,0. How can i take care about wm decorators ? Am i doing
something wrong ?

I think you want wmwindow

-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment

Unfortunatly, it give me the same result :-/–
jabber : lordheavy at jabber.fr
mail : lordheavymREMOVEME at gmail.com

Unfortunatly, it give me the same result :-/

Sorry, no idea. Does anyone else know how to get the size of the window
decorations on different window managers?

-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment