Toggle to full screen when using SDL_WINDOWID environment variable

I’m using SDL_WINDOWID environment variable to display video on a gtk
widget. Il works great. The problem is when I’m trying to toggle to
full screen.

The video is resizing to width and height of the screen, but it stays
embedded in my application.

Here are my configurations :

using sdl on fedora core 3 : X11

I’m doing that to take the resolution of the screen

Display *dpy;

dpy = XOpenDisplay(NULL);

if (dpy) {

fs_screen_width = DisplayWidth(dpy, DefaultScreen(dpy));

fs_screen_height = DisplayHeight(dpy, DefaultScreen(dpy));

XCloseDisplay(dpy);

}

I’m doing that to go in full screen mode :
int w, h, flags;

is_full_screen = !is_full_screen;


/* use the recorded resolution */

flags = SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_HWACCEL;

if (is_full_screen) {

    w = fs_screen_width;

    h = fs_screen_height;

    flags |= SDL_FULLSCREEN;

} else {

    w = screen_width;

    h = screen_height;

    flags |= SDL_RESIZABLE;

}

screen = SDL_SetVideoMode(w, h, 0, flags);

cur_stream->width = w;

cur_stream->height = h;

this is in part code taken from ffplay (ffmpeg group), the only
difference is that I’m using sdl_windowid.

Anyone have an idea to help me?

Thanks a lot

Nic–
“Two things are infinite: the universe and human stupidity. I’m not
sure about the universe.” (Albert Einstein)

Nicolas Gendron wrote:

I’m using SDL_WINDOWID environment variable to display video on a gtk
widget. Il works great. The problem is when I’m trying to toggle to
full screen.

The video is resizing to width and height of the screen, but it stays
embedded in my application.

This is in X11_SetVideoMode():

/* Check the combination of flags we were passed /
if ( flags & SDL_FULLSCREEN ) {
/
Clear fullscreen flag if not supported */
if ( SDL_windowid ) {
flags &= ~SDL_FULLSCREEN;
}
}

It looks like what you’re trying to do is simply unsupported. Sorry. I
imagine that it wouldn’t be too difficult to hack the code so that when
you switch to fullscreen, SDL creates a new window for you, and then
when you switch back, it destroys that window and uses the SDL_WINDOWID
one instead. I don’t know much about X11, though, so I’m not certain if
that’s the best approach.–
Jon