-
-
Notifications
You must be signed in to change notification settings - Fork 479
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
Switch from ndk-glue
to raw-window-handle
crate
#1418
Conversation
`winit` provides a `raw-window-handle` specifically for crates to process window pointers/references in a crate-agnostic way. `glutin` can use it too, to get rid of its `ndk-glue` dependency which otherwise has a hard versioning dependency as it should be updated in sync with `winit`. Over time this should be worked into the other backends, in turn removing `winit` from the `new_windowed()` function signature and replacing it with `impl HasRawWindowHandle` or `dyn HasRawWindowHandle`. This will also allow Android users to pass generic `Surface`s (first converted to a so-called `NativeWindow` in the NDK through [#272], then passed as `RawWindowHandle` thanks to [#274]) created in Java / Kotlin / Flutter to render to individual UI elements instead of the entire screen with a `NativeActivity` (`ndk-glue`). It'll in turn make the code more generic, too, as `raw-window-handle` has a variant for every platform / windowing system currently supported by glutin. [#272]: rust-mobile/ndk#272 [#274]: rust-mobile/ndk#274
This looks good to me. Removing the direct dependency on the glue will make things easier. 👍 |
@jamienicol can you give an explicit review approval or should I just merge this in, given that @kchibisov gave me free reign over the Android guts of glutin? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I've never really been a big fan of the tight coupling between |
@maroider the same opinion was voiced by @kchibisov. I think we can have isolated cases where However, some of this may hinge on Android-specific concerns raised recently, regarding platform divergence. (Edit: see also the second paragraph: my intention is to get rid of it almost completely anyway) |
Do we have an issue outlining these intentions? If not, then we should probably make one. |
I don't think so, as I was planning to just "get it over with in a PR soon/quickly™", but feel free to create one as I don't know when I can (would like to get current open PRs and issues fleshed out, but I do have some in-progress changes to migrate to "pure" |
winit
provides araw-window-handle
specifically for crates to process window pointers/references in a crate-agnostic way.glutin
can use it too, to get rid of itsndk-glue
dependency which otherwise has a hard versioning dependency as it should be updated in sync withwinit
.Over time this should be worked into the other backends, in turn removing
winit
from thenew_windowed()
function signature and replacing it withimpl HasRawWindowHandle
ordyn HasRawWindowHandle
. This will also allow Android users to pass genericSurface
s (first converted to a so-calledNativeWindow
in the NDK through #272, then passed asRawWindowHandle
thanks to #274) created in Java / Kotlin / Flutter to render to individual UI elements instead of the entire screen with aNativeActivity
(ndk-glue
). It'll in turn make the code more generic, too, asraw-window-handle
has a variant for every platform / windowing system currently supported by glutin.CC @jamienicol
cargo fmt
has been run on this branchcargo doc
builds successfullyCHANGELOG.md
if knowledge of this change could be valuable to users