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 1675

Summary: X11 MakeCurrent implementation doesn't correctly unset GL context
Product: SDL Reporter: Edward Rudd <urkle>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: icculus
Version: HG 2.0   
Hardware: All   
OS: Linux   
Attachments: Patch to correct the MakeCurrent implementation for X11 OpenGL

Description Edward Rudd 2012-12-31 14:41:13 UTC
Created attachment 1004 [details]
Patch to correct the MakeCurrent implementation for X11 OpenGL

the SDL_GL_MakeCurrent implementation in SDL_x11opengl.c incorrectly handles the "unsetting" context case.

When called with a "0" or NULL context the correct GLX call should be

glXMakeCurrent(TheDisplay, None, 0);

However what is actually happening is this

glXMakeCurrent(TheDisplay, TheWindow, 0);

This causes an X client error and effectively blows things up.

The issue seems to be an incorrectly written ternary operator when calculating the drawable.
Comment 1 Ryan C. Gordon 2012-12-31 16:41:32 UTC
This is now hg changeset a0d42781fa92, thanks!

--ryan.