SDLWINDOWID and Fullscren

Hi,

I’m using SDL in my MPEG-1 player frontend whith smpeg, and at startup I
want to display the video in a gtk window so I do the trick :-----

  sprintf(SDL_windowhack,"SDL_WINDOWID=%d",
          ((GdkWindowPrivate *)(window->window))->xwindow);
  putenv(SDL_windowhack);

But later I want to switch to fullscreen mode (while playing the MPEG
stream).

The fact is that if I dont do the “hack” when launching (i.e the MPEG
plays in a separate window (not GTK) at the begining), I can use
SDL_WM_ToggleFullScreen() and it works.

But since I do the hack, the SDL_WM_ToggleFullScreen() doesn’t work,
even if I do a :

unsetenv(“SDL_WINDOWID”)…

I’ve tried whith SDL 1.0.4 (using the key binding) and whith SDL 1.1.0
(whith the new function)…

Any solution to my problem?

Thanks.


Damien Chavarria.

“There are two major products that come from Berkeley : LSD and UNIX. We
don’t believe this to be a coincidence.”

I’m using SDL in my MPEG-1 player frontend whith smpeg, and at startup I
want to display the video in a gtk window so I do the trick :


  sprintf(SDL_windowhack,"SDL_WINDOWID=%d",
          ((GdkWindowPrivate *)(window->window))->xwindow);
  putenv(SDL_windowhack);

But later I want to switch to fullscreen mode (while playing the MPEG
stream).

Since the user could toggle fullscreen mode, I presumed that if you wanted
to manage the window yourself, that I shouldn’t mess with the window state.

However, if you want to try it, edit the file:
src/video/x11/SDL_x11video.c
and in the function X11_ToggleFullScreen(), comment the section:

    /* Don't switch if we don't own the window */
    if ( SDL_windowid ) {
            return(0);
    }

Let me know if this works well for you, since if it does, I’ll be happy
to change it in SDL 1.1.

See ya!
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Sam Lantinga wrote:

Let me know if this works well for you, since if it does, I’ll be happy
to change it in SDL 1.1.

Well…obviously it doesn’t. All I get is :------------

Gdk-ERROR **: BadWindow (invalid Window parameter)
serial 41 error_code 3 request_code 12 minor_code 0
Gdk-ERROR **: BadWindow (invalid Window parameter)
serial 42 error_code 3 request_code 12 minor_code 0


Is the window destroyed or altered in some way when switching to full
screen? If it is I understand why I got this error (since the gtk window
is my main window)…

Would it be possible to have it working? It would be great since I could
switch to full screen whithout having to pause the mpeg and it would be
useful for all smpeg users…)

Ho…and by the way : when I set the SDL_WINDOWID var, I can’t go to
full screen mode even if I destroy the surface and request a new one in
fullscreen…I need to Quit and re-Init SDL…and smpeg doesn’t like
that at all :slight_smile:

It could already be great if I was able to create a new surface in
fullscreen mode if I previously set SDL_WINDOWID, created a windowed
surface and removed SDL_WINDOWID from the environement…

Is it possible to do something about it?


Damien Chavarria.