I have switched to using a GStreamer element that is also a GTK+ widget. This avoids all the X11 specific overlaying. Now I do not need to know if the platform is Wayland or not. :-)