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 - X11 MakeCurrent implementation doesn't correctly unset GL context
Summary: X11 MakeCurrent implementation doesn't correctly unset GL context
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: All Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-31 14:41 UTC by Edward Rudd
Modified: 2012-12-31 16:41 UTC (History)
1 user (show)

See Also:


Attachments
Patch to correct the MakeCurrent implementation for X11 OpenGL (712 bytes, patch)
2012-12-31 14:41 UTC, Edward Rudd
Details | Diff

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