Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/mobile/app: need to pass a private colormap to XCreateWindow in x11.c #9997

Closed
db47h opened this issue Feb 25, 2015 · 5 comments
Closed

x/mobile/app: need to pass a private colormap to XCreateWindow in x11.c #9997

db47h opened this issue Feb 25, 2015 · 5 comments
Milestone

Comments

@db47h
Copy link

@db47h db47h commented Feb 25, 2015

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.

@crawshaw
Copy link
Contributor

@crawshaw crawshaw commented Feb 25, 2015

/cc @nigeltao

@nigeltao
Copy link
Contributor

@nigeltao nigeltao commented Feb 25, 2015

I'm happy to take a patch a la https://golang.org/doc/contribute.html but I can't repro the bug myself so can't be sure that whatever I write will fix anything.

Out of curiousity, what sort of X11 configuration leads to this situation?

@mikioh mikioh added the repo-mobile label Feb 25, 2015
@db47h
Copy link
Author

@db47h db47h commented Feb 26, 2015

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:

  number of visuals:    228
  default visual id:  0x21
  visual:
    visual id:    0x21
    class:    TrueColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff0000, 0xff00, 0xff
    significant bits in color specification:    8 bits
(...)
  visual:
    visual id:    0x27
    class:    TrueColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff0000, 0xff00, 0xff
    significant bits in color specification:    8 bits

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.

@db47h
Copy link
Author

@db47h db47h commented Feb 27, 2015

CL submitted: https://go-review.googlesource.com/6260

For future reference, people affected by this issue will get the following error message:

X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  1 (X_CreateWindow)

Also the problem I was experiencing with the basic example is unrelated. It was caused by #9534.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title mobile/app: need to pass a private colormap to XCreateWindow in x11.c x/mobile/app: need to pass a private colormap to XCreateWindow in x11.c Apr 14, 2015
@rsc rsc modified the milestones: Unreleased, Unplanned Apr 14, 2015
@rsc rsc removed the repo-mobile label Apr 14, 2015
@nigeltao
Copy link
Contributor

@nigeltao nigeltao commented Apr 28, 2015

This was fixed by https://go-review.googlesource.com/#/c/6260/ but the CL description said issue #9997 instead of #9997.

@nigeltao nigeltao closed this Apr 28, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.