Simple window rendering problem with pyGLFW and Ubuntu on Wayland

Viewed 88

I'm using Ubuntu 20.04.3 and Python 3.8.10 on x64 CPU. Logged in to Ubuntu on Wayland. This simple test of pyGLFW 2.4.0:

import glfw

glfw.init()
window = glfw.create_window(640, 480, "Hello World", None, None)
glfw.make_context_current(window)

while not glfw.window_should_close(window):
  glfw.swap_buffers(window)
  glfw.poll_events()

glfw.terminate()

produces a defective window:

enter image description here

with this warning:

/home/paul/vis/.vis/lib/python3.8/site-packages/glfw/__init__.py:906: GLFWError: (65544) b'Wayland: Focusing a window requires user interaction'
  warnings.warn(message, GLFWError)

With normal login (X11?) the window produced by this script looks fine:

enter image description here

What is the problem? I prefer using Wayland, because I can't fix screen tearing on this PC with X11. Yes, I tried many helpful hints from interwebs.

0 Answers
Related