> Does the problem happen when running on X11? You can force X11 by > setting environment variable: > > GDK_BACKEND=x11 > > before starting your program. That was an excellent question that found part of the problem:
GDK_BACKEND was already set to x11 due to my debugging. If I unset the environment variable the problem disappears => Logged in into a non-wayland session and the problem appeared again. Thanks a lot, Gunter.