QTodoTxt2
QTodoTxt2 copied to clipboard
ensure the correct GL library is loaded
On Debian Stretch, I'm getting nasty OpenGL-related errors and a solid black window:
QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
QOpenGLShader: could not create shader
shader compilation failed:
""
QOpenGLShaderProgram::uniformLocation( matrix ): shader program is not linked
QOpenGLShaderProgram::uniformLocation( opacity ): shader program is not linked
After digging a bit, it turns out this is due to pyqt5 resolving libGL.so to the mesa version instead of the nvidia one (I'm running the nvidia proprietary driver). This was originally reported for pyqt4 in https://bugs.launchpad.net/ubuntu/+source/python-qt4/+bug/941826 which also provides the fix I'm using in this PR.
Thank you for debugging this and find a solution! But I am unsure how to solve it properly. Adding code for a low level platform specific issue in a high level program is a good way to get issues in the future...
Yeah, this is definitely a hack, and a linux-specific one at that (possibly debian/ubuntu specific, though I suspect other distros might be affected, and it should be a noop if they aren't). I'll update this to make sure it's gated properly.
This is more than linux specific (I run ubuntu and never have seen such an issue), it is specific to linux users with nvidia proprietary driver installed. I think for now the best is to leave that PR open so people who get that issue can just pull it
Thanks @oroulet. I've rebased this and changed the check to specifically gate the workaround to the presence of the nvidia driver. While I agree it likely is only a significant issue in this specific case, it's not that uncommon of a config, and I'd love to see this merged at some point to save other potential users the pain of having to figure this out by themselves.
I had the same issue as I'm using nvidia drivers, a way to solved was to:
- Install pyOpenGL
pip3 install pyopengl
- Add the following import to
qtodotxt2\app.py
from OpenGL import GL