Problems with GLFW and Qt in the same process

Hello,

I have a shared library that renders off-screen and I want to use GLFW 3.3 for creating its OpenGL context (it was using FreeGLUT before). This library is then used in a Qt 4.8 application, which seems to cause weird interactions (observed on Linux with an Nvidia GPU). As soon as the rendering functionality of the library was initialized and I try to show a specific window of the GUI, the whole application closes. Doing the same works fine when the OpenGL context was created by FreeGLUT.

Are there any known problems with this setup? I already found some discussions about using GLFW and Qt in the same process such as this GitHub issue, but they only mention problems with event processing. I don’t use GLFW’s event handling at all, or at least I don’t call any functions related to it. Are there any other known incompatibilities or things that I should pay attention to when using GLFW and Qt in the same process?

Some more information: The problem seems to be caused by a window icon with transparency. When the window with this icon gets shown on the screen, Qt prints the following error:

X Error of failed request:  BadDrawable (invalid Pixmap or Window parameter)
  Major opcode of failed request:  62 (X_CopyArea)
  Resource id in failed request:  0x0
  Serial number of failed request:  1209
  Current serial number in output stream:  1212

The same error is also printed when using FreeGLUT, but the window works without any problems there. The application closes only when using both GLFW and the icon with transparency. This would suggest that there is some difference in how GLFW creates the invisible X server window for off-screen rendering compared to FreeGLUT.