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 - Switch from resizable to not resizable does not work.
Summary: Switch from resizable to not resizable does not work.
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 1.2.11
Hardware: x86 Linux
: P1 minor
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-17 11:11 UTC by Sean Farrell
Modified: 2007-07-07 18:51 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.