EGL `create_surface` is unsound
See https://github.com/gfx-rs/wgpu/blob/434f1974101daf26dc3fd15c1a356738d6720bff/wgpu-hal/src/gles/egl.rs#L938-L942
This function does not actually use the display_handle. However, the window_handle is only valid if used together with the display_handle.
For wayland, the code destroys the current context (on the first use). However, at that point the context has already been cloned into different objects that will continue to use it. The same happens if this function is ever called with two different display handles.
This sounds very closely related to all the details outlined in #5505 and #6211 which all cover lack of proper usage of RawDisplayHandle to some extent, and papering over it with gems like https://github.com/gfx-rs/wgpu/blob/6f16ea460ab437173e14d2f5f3584ca7e1c9841d/wgpu-hal/src/gles/egl.rs#L935-L979 :)
Closing in favor of those issues
Thanks @cwfitzgerald. Would be awesome to start tackling those issues, if there's sign-off to delete the current atrocity and rewrite it with glutin :grin:
Yeah if you can pull it off such that it works with our api, less code to maintain would be lovely!