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 2027

Summary: Full-screen appears to be broken - crash in SDL_DestroyWindow
Product: SDL Reporter: Rainer Deyke <rainerd>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: critical    
Priority: P2 Keywords: target-2.0.0
Version: HG 2.0   
Hardware: x86_64   
OS: Linux   
Attachments: test program

Description Rainer Deyke 2013-08-10 06:02:01 UTC
Created attachment 1281 [details]
test program

I'm running Linux Mint 15 with the Cinnamon window manager.  SDL_DestroyWindow consistently locks up for me when the window if fullscreen.  See the attached test program: test case 0 (windowed mode) works, but test cases 1-3 (SDL_WINDOW_FULLSCREEN_DESKTOP, SDL_WINDOW_FULLSCREEN without mode change, and SDL_WINDOW_FULLSCREEN with mode change respectively) all lock up in the call to SDL_DestroyWindow, requiring a 'kill -9'.
Comment 1 Sam Lantinga 2013-08-10 13:59:49 UTC
This sounds pretty serious and I'd like to get a fix for this before release on Monday.  I haven't seen this before. Have you attached a debugger to find out what's happening?
Comment 2 Rainer Deyke 2013-08-11 02:57:00 UTC
The problem seems to be on line 1194 of SDL_x11window.c, in the X11_EndWindowFullscreenLegacy function.  The line looks like this:

    XIfEvent(display, &ev, &isMapNotify, (XPointer)&data->xwindow);

Replacing the blocking XIfEvent call with a non-blocking XCheckIfEvent seems to fix the problem, but I can't tell if this is actually correct or if this breaks something else.
Comment 3 Sam Lantinga 2013-08-11 22:57:34 UTC
I think that fix is okay here.  Thanks!
http://hg.libsdl.org/SDL/rev/d6a8fa507a45