Skip to content

raw_window_handle crashes on MacOS #82

@Goldenbough44

Description

@Goldenbough44

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions