We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 441

Summary: Switch from resizable to not resizable does not work.
Product: SDL Reporter: Sean Farrell <sean.farrell>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: minor    
Priority: P1    
Version: 1.2.11   
Hardware: x86   
OS: Linux   

Description Sean Farrell 2007-06-17 11:11:54 UTC
If you try to set a video mode with no resizable but the previous mode is resizable the the flag is not set. (Although the window behaves as expected.)

Here code that illustrates the problem:

/*
 * This program displays a deficiency in SDL.
 *
 * If the video mode was once set resizable it is impossible to set the mode
 * not to be resizable.
 *
 * compile: gcc `sdl-config --cflags --libs` resizable.c
 */

#include "SDL.h"
#include "stdio.h"
#include "assert.h"

void print_resizable() {
  SDL_Surface* screen = SDL_GetVideoSurface();
  assert(screen);
  if ((screen->flags & SDL_RESIZABLE) == 0) {
    printf("screen is not resizable\n");
  } else {
    printf("screen is resizable\n");
  }  
}

int main() {
  SDL_Init(SDL_INIT_VIDEO);
  
  SDL_SetVideoMode(800,600,0,0);
  print_resizable();
 
  SDL_Delay(10000);
  
  SDL_SetVideoMode(800,600,0,SDL_RESIZABLE);
  print_resizable();
 
  SDL_Delay(10000);
  
  SDL_SetVideoMode(800,600,0,0);
  print_resizable();  // this reports a error
  
  SDL_Delay(10000);
  
  SDL_Quit();
}
Comment 1 Ryan C. Gordon 2007-07-07 18:51:08 UTC
Fixed in svn revision #3168, thanks!

--ryan.