SDL and Window Positionning

Hi,

In my application (under Linux) I create a windowed-mode surface whith
SDL_SetVideoMode, and then I would like to put the window at a precise
location in the screen.

As far as I know there is no SDL function to do that, so I use the
manual-hack way. I call SDL_GetWMInfo() to get the surface’s window id
and then I try to run XConfigureWindow on it :

Here’s the code I use :--------------
XWindowChanges changes;

SDL_GetWMInfo(&sdl_info);

changes.x = 400;
changes.y = 300;

sdl_info.info.x11.lock_func();
XConfigureWindow(sdl_info.info.x11.display,
sdl_info.info.x11.window,
CWX | CWY,
&changes);
sdl_info.info.x11.unlock_func();


But all I got is a segfault…(triggered by the XConfigureWindow).
I tried whith x11.window and x11.wmwindow…

As anywone already done that ? Any help is welcome…

Thanks,


Damien Chavarria.

As far as I know there is no SDL function to do that, so I use the
manual-hack way. I call SDL_GetWMInfo() to get the surface’s window id
and then I try to run XConfigureWindow on it :

I know this is really late, but I’m going through old SDL mail… :slight_smile:

http://www.libsdl.org/faq/FAQ-Linux.html#LINUX_13

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software