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 963

Summary: Crash with OpenGL & window resizing (SVN 1.3, revision 5557), SDL_OnWindowFocusLost
Product: SDL Reporter: Matthias <matthias.schweinoch>
Component: timerAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: critical    
Priority: P2 CC: matthias.schweinoch
Version: HG 2.0   
Hardware: x86_64   
OS: Linux   
Attachments: program to reproduce crash
Fix in method SDL_CreateWindow
Fix in method SDL_CreateWindow

Description Matthias 2010-03-02 11:22:30 UTC
Created attachment 495 [details]
program to reproduce crash

Multiple resize operations with an SDL & OpenGL window cause a crash in SDL_video.c:1427

SDL_OnWindowFocusLost

The pointer 'display' is 0.

Use the attached program to reproduce.

SDL 1.2 runs this program without crashing.

Also note that on SDL 1.2, when you resize the window, the top-left corner remains where it is. With SDL 1.3, the window is always generated at a slightly different position.

For your information: I am running Ubuntu linux 9.10, x64 with 2.6.31-19-generic. I am using the nvidia binary driver (see information below)

server glx vendor string: NVIDIA Corporation
server glx version string: 1.4
client glx vendor string: NVIDIA Corporation
client glx version string: 1.4
GLX version: 1.3
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce 9800 GTX+/PCI/SSE2
OpenGL version string: 3.0.0 NVIDIA 185.18.36
OpenGL shading language version string: 1.30 NVIDIA via Cg compiler
Comment 1 Jim 2010-04-02 11:38:04 UTC
Created attachment 503 [details]
Fix in method SDL_CreateWindow

SDL_VideoFlags was not being set for GL windows. This caused resize to always think flags had changed, and constantly create new windows. 

Creating new windows probably shouldn't change the window position and lead to the crash, but that's another problem...
Comment 2 Jim 2010-04-02 11:46:41 UTC
Created attachment 504 [details]
Fix in method SDL_CreateWindow
Comment 3 Sam Lantinga 2011-02-16 02:57:48 UTC
The crash was already fixed, but as you said, it shouldn't recreate the window.
http://hg.libsdl.org/SDL/rev/035797f48321

Thanks!