Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
x/mobile/app: need to pass a private colormap to XCreateWindow in x11.c #9997
When the preferred visual returned by EGL is different from the parent window's visual, a private colormap is needed in the call to XCreateWindow (see X server source code http://cgit.freedesktop.org/xorg/xserver/tree/dix/window.c#n708).
This seems to be a known issue as some of the proposed fixes for other issues also include a fix for this (see for example https://github.com/capnm/mobile/blob/patch-1/app/x11.c#L49), but haven't seen it formally reported, so here it is.
It's a pretty bog standard Ubuntu 14/04 config with the Nvidia 340 binary drivers. The examples used to work when I tested right after Go 1.4 got released, but not anymore, and I really couldn't say what has changed on my system since then.
Anyhow, when I debugged this issue, EGL returned visual id 0x27 while the default is 0x21, as reported by xdpyinfo:
There's probably more to it, but they look the same.
Adding the colormap is straightforward, but I ran into another issue with the basic example that crashes somewhere in gl.DrawArrays(), so I want to investigate this further before submitting a patch (I don't see how adding a true color colormap could cause this, but one never knows). The sprite example runs fine though.
CL submitted: https://go-review.googlesource.com/6260
For future reference, people affected by this issue will get the following error message:
Also the problem I was experiencing with the basic example is unrelated. It was caused by #9534.