jonwright / pyopengltk

OpenGL frame for Python/Tkinter via ctypes and pyopengl
MIT License
54 stars 13 forks source link

[Linux] Creating context fails with BadDrawable #14

Closed ThenTech closed 4 years ago

ThenTech commented 4 years ago

I am trying to integrate a Tkinter backend into VisPy using this library for its OpenGLFrame.

However when trying to test on a virtual Ubuntu machine I get the following output:

GLX version: 1.4
Screen is  0
Number of FBconfigs 90
Got a matching visual: index 32 33 xid 0x21
Is Direct?:  1
X Error of failed request:  BadDrawable (invalid Pixmap or Window parameter)
  Major opcode of failed request:  55 (X_CreateGC)
  Resource id in failed request:  0x460002d
  Serial number of failed request:  16
  Current serial number in output stream:  18

So it fails when trying to call GLX.glXMakeContextCurrent. Any idea why?

arcanosam commented 4 years ago

I found this when I googling for the error: BadDrawable (invalid Pixmap or Window parameter)

https://stackoverflow.com/a/56430683

It's add this line QT_X11_NO_MITSHM=1 in /etc/environment

Hope it helps

ThenTech commented 4 years ago

It's add this line QT_X11_NO_MITSHM=1 in /etc/environment

I had found that too, but it appears to do nothing. The same error occurs.

For reference, running e.g. glmark2 works, as does using Qt with its OpenGL frame. So it might be related to the setup here and trying to do this in a VM.

The reason why I am trying to test this, is because some the VisPy tests fail on Linux through Travis, but the log does not specify why, so running them myself might reveal something.

ThenTech commented 4 years ago

I solved it. I think it was caused by calling self.tkMap(None) before the window was actually visible (this was not a problem on Winsows). So it works now as intended.

20-10-02 18 19 14