Repository navigation
fix(x11): Decline a GLX context the X server rejected - #26288
Merged
ramezgerges merged 1 commit intoNov 10, 2026
Merged
ramezgerges merged 1 commit into
ramezgerges merged 1 commit into
Conversation
GLX errors are asynchronous: a driver can hand back a context handle for a glXCreateNewContext the server then rejects (BadValue on X_GLXCreateNewContext, as reported on NVIDIA). Since the host's X error handler only logs, that context was accepted and every frame's glXMakeCurrent failed, with no fallback. Count X errors in the handler, and after creating the context check that none arrived across an XSync and that it can be made current on the new window. Otherwise destroy it and throw, so the negotiation falls back to the next backend. Fixes unoplatform#23338 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Contributor
|
This pull request is merged. |
Contributor
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
Contributor
|
The build 245226 found UI Test snapshots differences: Details
|
ajpinedam
approved these changes
Nov 10, 2026
ajpinedam
left a comment
Contributor
There was a problem hiding this comment.
@ramezgerges Let me know if you want me to test this fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub Issue: closes #23338
PR Type:
🐞 Bugfix
What changed? 🚀
#23338 reported the X11 host dying on
X_GLXCreateNewContextBadValue(NVIDIA) instead of falling back. Two of the three parts are already handled on master:ba0313d7d1b, in 6.7.65+), so the error no longer kills the process.The remaining gap: GLX errors are asynchronous, so a driver can return a non-null context for a request the server then rejects. Nothing checked for that, so the context was accepted and every frame's
glXMakeCurrentfailed (logged only): a black window, no fallback.CreateGLXWindownow:XSyncafterglXCreateNewContext;Declining destroys the context/window and throws, so
CreateWindowAndContextfalls through to the next backend (EGL/GLES, then software).Validation (SamplesApp
net10.0-desktopfrom this branch, WSL Ubuntu 24.04 + Xvfb, Mesa):UNO_X11_RENDERER=OpenGL): still wins negotiation onOpenGLand renders (no false decline from the new checks).VK_ICD_FILENAMES=/nonexistent.json LIBGL_ALWAYS_INDIRECT=1): reproduces the reportedErrorCode: 2 (BadValue),MinorCode: 24 (X_GLXCreateNewContext),ResourceId: 0x0; the app logs it, falls back toOpenGLESand renders. On MesaglXCreateNewContextreturns null itself here, so this goes through the existing null check.glXCreateNewContextwas declined with "glXCreateNewContext was rejected by the X server", and the app fell back toOpenGLESand rendered. Not tested on an NVIDIA driver.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code