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

raw_window_handle crashes on MacOS #82

Open
Goldenbough44 opened this issue Jan 29, 2025 · 1 comment
Open

raw_window_handle crashes on MacOS #82

Goldenbough44 opened this issue Jan 29, 2025 · 1 comment

Comments

@Goldenbough44
Copy link
Contributor

The place error happens:

//raw_window_handle.rs
let ns_view = msg_send![ns_window as *mut NSObject, contentView];

Error messages:

invalid message send to -[SDL3Window contentView]: expected return to have type code '@', but found '^v'

This error didn't exist yesterday, I could run code without any problom. I think it is because of the version up of objc2 crate.

objc2 crate's latest docs(https://docs.rs/objc2/latest/objc2/macro.msg_send.html) says Type verification required for msg_send! macro, but 0.5.2 version(which is the minimal dependency version of sdl3 crate) docs(https://docs.rs/objc2/0.5.2/objc2/macro.msg_send.html) does not mentioned about it.

I think there are two options to handle this,

  1. add dependency features for objc2 crate
    From the crate's docs: This behaviour can be tweaked with the "relax-void-encoding", "relax-sign-encoding" or "disable-encoding-assertions" Cargo feature flags if it is causing you trouble.

  2. do type verification.

I think 2 would be good solution.

I didn't tested either solutions, but I think I can in some days. Can I make a branch for it and create PR?

@revmischa
Copy link
Collaborator

Please do!

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

2 participants