Repository: Rust-SDL2/rust-sdl2 (language: rust)

Issue:
Support raw-window-handle in emscripten
Hi! 
the impl for HasRawWindowHandle does not currently support the Web variant, which is needed for running wgpu in the browser via emscripten.

I'm not entirely sure how this handle should be created from SDL2's side, but the [raw-window-handle docs](https://docs.rs/raw-window-handle/latest/raw_window_handle/struct.WebHandle.html) state that it should simply return a non-zero id.

I'm not sure if the SDL2 library proper interfaces with JavaScript at all or if that's entirely within emscripten's jurisdiction, but I found I can successfully create a wgpu renderer by simply adding the following code to the HasRawWindowHandle impl:
```rs
#[cfg(target_os = "emscripten")]
{
    use self::raw_window_handle::WebHandle;
    let mut handle = WebHandle::empty();
    handle.id = 1;
    return RawWindowHandle::Web(handle);
}
```

I can make a PR with that change on its own but I'm not sure it's semantically correct (it would likely break using multiple windows, for example) and wanted to submit an issue first to ask.


Discussion / hints:
Feel free to make a PR. I'm not sure having multiple windows is an issue, can you even have multiple windows in the web?
It looks like [emscripten doesn't support multiple SDL windows anyway](https://github.com/emscripten-core/emscripten/issues/5081), so I'll just submit this as-is.

Fix patch:
diff --git a/src/sdl2/raw_window_handle.rs b/src/sdl2/raw_window_handle.rs
index 4a35ab7798..14a3a83209 100644
--- a/src/sdl2/raw_window_handle.rs
+++ b/src/sdl2/raw_window_handle.rs
@@ -8,6 +8,15 @@ unsafe impl HasRawWindowHandle for Window {
     fn raw_window_handle(&self) -> RawWindowHandle {
         use self::SDL_SYSWM_TYPE::*;
 
+        // Check if running on web before continuing,
+        // since SDL_GetWindowWMInfo will fail on emscripten
+        if cfg!(target_os = "emscripten") {
+            use self::raw_window_handle::WebHandle;
+            let mut handle = WebHandle::empty();
+            handle.id = 1;
+            return RawWindowHandle::Web(handle);
+        }
+
         let mut wm_info: SDL_SysWMinfo = unsafe { std::mem::zeroed() };
 
         // Make certain to retrieve version before querying `SDL_GetWindowWMInfo`


Test patch: