| Summary: | Maximize Button/SDL_RESIZABLE Flag | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Jonathan Greig <redteam316> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED INVALID | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | redteam316 |
| Version: | 1.2.13 | Keywords: | target-1.2.14 |
| Hardware: | x86 | ||
| OS: | Linux | ||
Tagging this bug with "target-1.2.14" so we can try to resolve it for SDL 1.2.14. Please note that we may choose to resolve it as WONTFIX. This tag is largely so we have a comprehensive wishlist of bugs to examine for 1.2.14 (and so we can close bugs that we'll never fix, rather than have them live forever in Bugzilla). --ryan. Yes, this is the expected behavior. You can't change the resize hints on a window in X11 once it's been shown and registered with the window manager. (We should probably tear down the window and rebuild it for this sort of case in SDL 1.3.) As a workaround for 1.2, if you need to add/remove SDL_RESIZABLE, you can probably call SDL_Quit() then SDL_Init() before SDL_SetVideoMode() to "fix" this. --ryan. |
I tested, and apparently to be able to use the maximize button, 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_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 800x600 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; I am using SDL 1.2.13 on Kubuntu 8.04 "Hardy Heron" and that it where I reproduced this from. I haven't tested on Windows at this point but I would think it occurs there too.