How to get the current video resolution used by the window manager / windows?


I’m currently programming a picture viewer program with SDL lib in Linux X11,
and I would like to use the fullscreen.

But if for example my picture is in 640x480 resolution, he switches in 640x480
resolution mode, but I prefer to use the current video resolution of the window
manager in fullscreen mode.

My current window manager resolution is 1024x768, but it’s impossible to get this
values, I tried also videmodeok with the flags SDL_FULLSCREEN, and he say me, that
the resolution is possible in fullscreen, but it’s not true, when I try it, it
doesn’t work, he switches in windowed mode.

Is there something possible to get the current resolution used by the window
manager or must I try to use directly a xlib function? (it would be a little very
complicate, without modifying the libsdl code).–