Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect raw-handle to MacOs, fix included #1116

Closed
sanbox-irl opened this issue Jun 16, 2021 · 3 comments
Closed

Incorrect raw-handle to MacOs, fix included #1116

sanbox-irl opened this issue Jun 16, 2021 · 3 comments

Comments

@sanbox-irl
Copy link

Hello!

In this PR, #962, at some point, the author included this line in their MacOS implementation:

                    ns_view: 0 as *mut libc::c_void, // consumer of RawWindowHandle should determine this

This was, as far as I can see, a mistake. By default, using sdl2 and wgpu, this will create a crash, as ns_view must be well defined for WGPU to work, and nothing implies that this value is incorrect. Moreover, on a philosophical level, the trait and its cross-platform nature is to force sdl2 and other windowing wrappers to correctly give these handles to graphics libraries like WGPU, so it seems to me that SDL2 should properly define ns_view.

The example here shows the workflow required: 92b4309

My question now is...why? Why aren't we providing the correct ns_view by default, and why do we expect users to do this strange song and dance?

@nightfly19
Copy link

There seem to have been some changes to raw-window-handle and WGPU since this issue was opened. I've updated the WindowWrapper hack and am posting it here in case it helps anyone.
wrapper.rs.txt

@toyboot4e
Copy link

Great! One year ago raw-window-handle was 0.3, while it's 0.4 toaday.

@joseluis
Copy link
Contributor

joseluis commented Oct 7, 2022

this should be closed by #1225

BTW now raw-window-handle is 0.5

@Cobrand Cobrand closed this as completed Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants