-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
feature is broken on all non-Windows OSes.
#57
Comments
Yeah I'm the one that did that, I only have windows so I can't test for other OSes, but fixing it should be pretty easy. The code as mostly all the same for each os before I updated it, so I'm guessing you'd just need to copy the code tweak it just a bit. I guess I can do that myself and just hope that the resulting code works, but if it doesn't then I won't be able to help with that |
Want to get check out #60 @Elabajaba ? |
Okay dang it I didn't check the code thoroughly enough and there's some more commented out code that's breaking raw-window-handle for me. That's definitely my fault, I'll make another pull request to quickly fix it but I'd say that you don't have to bother making a new release just for this fix unless someone actually needs it |
Oh yeah but other that I think this issue is fixed |
That same pull #53 seems to break the
|
Yeah, looks like those are nightly only for the moment. Seems like they'll be in rust 1.84 on edit: Whoops, got the date wrong for rust 1.84 it's out now as of this edit. |
I'm a little bit late to this, is any action still needed? If it's working fine then maybe we can just leave it, but it would probably nice to have a lower min rust version, right? I could easily just make another pull request, but there's not even any min supported rust version listed in the readme or toml |
I think there is still an issue on MacOS. Current implementation uses SDL_PROP_WINDOW_COCOA_WINDOW_POINTER to get NSView for MacOS, and directly use the return value to create AppKitWindowHandle of raw-window-handle. But from SDL3 documentation, it says that the prop returns the pointer of NSWindow, not NSView. So it seems that some action is needed to work properly on MacOS. |
Do you think this is something that you could fix yourself? |
I handled the issue using another crate (https://crates.io/crates/objc2-app-kit) that provide rust bindings of Apple's Appkit for my project. It seems SDL3 itself doesn't provide an api for NSview object. |
Wait, have you tried using |
That is about creating sdl window, as far as I know. When creating sdl window, you can specify your pre-created nsview as ptr using |
Oh yeah, I guess I should've seen that from the name. If that's the case then yeah I guess obj2-app-kit is necessary and I think it makes sense to add it as an optional dependency. Can you share how you were able to make it work? |
After A LOT of using chatgpt, it seems like this might work? It's using objc instead of the crate you mentioned, and I have no clue if it actually works, but I thought I'd just put it out here anyways
It's giving a warning about a cfg macro but that's just something the objc devs added for clippy and it's okay to ignore |
Yeah it seems have to work, Can you try to run it? If you can't, I'll try in few days. |
No I don't have a mac and I can't test it so yeah you'll have to test it |
I just pushed these changes to my own fork so that you can test it whenever you're ready (link) |
I fixed deps for compatibility and test to your fork and opened PR. link |
Okay I've opened a PR to move from my repo to this one, and I've edited the cargo.toml to make the objc dependency only activate on MacOs |
Great, if it works for people I can merge and release it |
@Goldenbough44 can you test my fork again? I changed the dep from objc to objc2 and I'm not sure if it still works |
@What42Pizza I fixed objc2's deprecated apis and opend PR for your fork. This works well. |
Thanks a lot, I'll merge to mine and hopefully merge from mine to this one |
#53 broke all the non-windows backends for for
raw_window_handle
by updating the dependency and changing the return type, then only fixing the#[cfg(target_os = "windows")]
blocks and not any of the other blocks.The text was updated successfully, but these errors were encountered: