HasRawWindowHandle for RawWindow fails on some platforms
Closed this issue · 3 comments
This was originally reported in parasyte/pixels#53
raw_window_handle
panics on some platforms (which I cannot reproduce) when SDL_GetWindowWMInfo
fails. The reported error is:
Application not compiled with SDL 2.0
Which I was able to track down to an issue with the way SDL_GetWindowWMInfo
is called. According to the libsdl wiki:
The info structure must be initialized with the SDL version, and is then filled in with information about the given window, as shown in the Code Example.
This suggests that beryllium
needs to populate the SDL_SysWMinfo
struct with the SDL version at a minimum. The default impl just zeros the struct:
beryllium/src/window/raw_window.rs
Lines 49 to 50 in cfdd6a3
@parasyte I've pushed the change to the master
branch, but you should have folks test the change before i push out a new version to crates.io
0.3.2 is out