SDL_MAXIMIZE Library?

I know that SDL doesn’t handle any window manager specific code(The grayed
out yet always present maximize button). What I am looking for is a library
that will handle it for me. I’ve found some info on how to do this in
Windows but I rarely boot into Windows anymore and usually only do for
testing purposes.

Is there a library available that can do this or at least examples so that I
can make my own lib?

I know that I can use SDL_RESIZABLE but it would be really nice if the last
part of it was rounded out by being able to use the maximize button.

You should have the maximize button if you use SDL_RESIZABLE. You may
have discovered a bug.On Thu, Jan 15, 2009 at 9:19 PM, Jonathan Greig wrote:

I know that SDL doesn’t handle any window manager specific code(The grayed
out yet always present maximize button). What I am looking for is a library
that will handle it for me. I’ve found some info on how to do this in
Windows but I rarely boot into Windows anymore and usually only do for
testing purposes.

Is there a library available that can do this or at least examples so that I
can make my own lib?

I know that I can use SDL_RESIZABLE but it would be really nice if the last
part of it was rounded out by being able to use the maximize button.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


http://codebad.com/

Hmm, I tested, and apparently, you must pass the SDL_RESIZABLE flag to the
video mode on THE VERY FIRST TIME IT IS INITIALIZED OR ELSE IT WONT WORK.

My code was setting:

/* Create a 640x480 OpenGL screen */
if ( SDL_SetVideoMode(640, 480, 0, SDL_RESIZABLE | SDL_OPENGL) == NULL )

{
fprintf(stderr, “Unable to create OpenGL screen: %s\n”,
SDL_GetError());
SDL_Quit();
exit(2);
}

on the very first initialization. And I was hitting SDLK_p to actually
change the video mode with this code in an SDL_Event while loop:

                  case SDLK_p:
                      /* Create a 640x480 OpenGL screen */
                      if ( SDL_SetVideoMode(800, 600, 0, SDL_RESIZABLE |

SDL_OPENGL) == NULL ) {
fprintf(stderr, “Unable to create OpenGL
screen: %s\n”, SDL_GetError());
SDL_Quit();
exit(2);
}

                      /* Set the title bar in environments that support

it */
SDL_WM_SetCaption(“CAD VIEWER TEST”, NULL);

                      /* Loop, drawing and checking events */
                      InitGL(800, 600);
                  break;

It does seem odd and could possibly be a bug. Why wouldn’t it enable the
maximize button after changing video modes with the P key? Is it because it
has lost touch with the window manager at that point? It’s apparently not
intuitive in the way it operates, as I would think that the maximize button
would become active and grayed depending on what video mode is set…

It works now that I put it in the first initialization, thanks Donny. Now Is
this a bug or merely a “feature”? :slight_smile:

Definitely a bug! Your investigation is appreciated!On Fri, Jan 16, 2009 at 2:21 AM, Jonathan Greig wrote:

Hmm, I tested, and apparently, you must pass the SDL_RESIZABLE flag to the
video mode on THE VERY FIRST TIME IT IS INITIALIZED OR ELSE IT WONT WORK.

It does seem odd and could possibly be a bug. Why wouldn’t it enable the
maximize button after changing video modes with the P key? Is it because it
has lost touch with the window manager at that point? It’s apparently not
intuitive in the way it operates, as I would think that the maximize button
would become active and grayed depending on what video mode is set…

It works now that I put it in the first initialization, thanks Donny. Now Is
this a bug or merely a “feature”? :slight_smile:


http://codebad.com/

Sheesh, correction. The code I posted for the initialization did not have
SDL_RESIZABLE with the bitwise operator. I accidentally pasted the code
after I made the fix. Just clarifying as not to confuse anyone.

Apparently we are posting in unison :stuck_out_tongue:

I never realized this before because I have been away from SDL for awhile
and last time I used it I was using SDL 1.2.9 on Windows. I never had the
need for SDL_RESIZABLE or OpenGL at that point. I had always been able to
reissue another video size but always thought the maximize wasn’t possible.

Now I am using SDL 1.2.13 on Kubuntu 8.04 “Hardy Heron” and that it where I
reproduced this from.

Unless I’m misunderstanding you, please file a bug report:

http://bugzilla.libsdl.org/On Fri, Jan 16, 2009 at 2:37 AM, Jonathan Greig wrote:

Apparently we are posting in unison :stuck_out_tongue:

I never realized this before because I have been away from SDL for awhile
and last time I used it I was using SDL 1.2.9 on Windows. I never had the
need for SDL_RESIZABLE or OpenGL at that point. I had always been able to
reissue another video size but always thought the maximize wasn’t possible.

Now I am using SDL 1.2.13 on Kubuntu 8.04 “Hardy Heron” and that it where I
reproduced this from.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


http://codebad.com/

Done :slight_smile:
http://bugzilla.libsdl.org/show_bug.cgi?id=680