pyGLFW: Can't create window on Wayland 3.36

Hi Florian, Using pyGLFW 1.11 on Wayland I get the following message when creating a window: …

  File "/home/aanjos/.local/lib/python3.8/site-packages/glfw/__init__.py", line 1156, in create_window
    return _glfw.glfwCreateWindow(width, height, _to_char_p(title),
  File "/home/aanjos/.local/lib/python3.8/site-packages/glfw/__init__.py", line 616, in errcheck
    _reraise(exc[1], exc[2])
  File "/home/aanjos/.local/lib/python3.8/site-packages/glfw/__init__.py", line 52, in _reraise
    raise exception.with_traceback(traceback)
  File "/home/aanjos/.local/lib/python3.8/site-packages/glfw/__init__.py", line 595, in callback_wrapper
    return func(*args, **kwargs)
  File "/home/aanjos/.local/lib/python3.8/site-packages/glfw/__init__.py", line 808, in _handle_glfw_errors
    raise GLFWError(message)
glfw.GLFWError: (65544) b'Wayland: Focusing a window requires user interaction'

I’ve tried the “fix” I’ve found on one of the solved issues:

if sys.platform.startswith("linux"):
            if "wayland" in os.getenv("XDG_SESSION_TYPE", "").lower():
                glfw.window_hint(glfw.FOCUSED, False)

However, I get the following:

File "/home/aanjos/Documents/git_sandbox/g3D/g3D/Drawable.py", line 36, in vbo_vertex_data
    gl.glVertexAttribPointer(layout_pos, 3, gl.GL_FLOAT, False, 0, None)

  File "/home/aanjos/.local/lib/python3.8/site-packages/OpenGL/latebind.py", line 63, in __call__
    return self.wrapperFunction( self.baseFunction, *args, **named )

  File "/home/aanjos/.local/lib/python3.8/site-packages/OpenGL/GL/VERSION/GL_2_0.py", line 469, in glVertexAttribPointer
    contextdata.setValue( key, array )

  File "/home/aanjos/.local/lib/python3.8/site-packages/OpenGL/contextdata.py", line 58, in setValue
    context = getContext( context )

  File "/home/aanjos/.local/lib/python3.8/site-packages/OpenGL/contextdata.py", line 40, in getContext
    raise error.Error(Error: Attempt to retrieve context when no valid context

Everything was working on Ubuntu 20.04. I’ve installed Debian testing today because it has the Linux kernel 5.5 and I got this problem.

I have libgfw3-wayland 3.3.2-1.

Thanks, António

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 23 (11 by maintainers)

Most upvoted comments

I was already discussing this on the pyOpenGL mailinglist:
https://sourceforge.net/p/pyopengl/mailman/pyopengl-users/thread/M5HjopY--3-2%40tutanota.com/

I think I might file a bug report with them, with that solution you just wrote.