rust-mobile / ndk

Rust bindings to the Android NDK
Apache License 2.0
1.11k stars 110 forks source link

ndk/native_window: Implement `HasWindowHandle` for 0.4 and 0.6 (and maintain 0.5) #434

Closed MarijnS95 closed 11 months ago

MarijnS95 commented 11 months ago

Following the same strategy in winit, move raw-window-handle 0.5 behind a rwh_05 feature and add raw-window-handle 0.4 and the newly released raw-window-handle 0.6 behind a corresponding rwh04/rwh_06 feature. The new non-raw trait and lifetimed type since 0.6 have been implemented instead, as raw-window-handle provides blanket implementations to coerce/convert back to Raw* types.

MarijnS95 commented 11 months ago

@kchibisov perhaps you also want to take a look at this PR in conjunction with https://github.com/rust-windowing/winit/pull/3126?

MarijnS95 commented 11 months ago

@kchibisov we never had it so I don't really feel like it adds any value unless there are compelling reasons to? Perhaps to keep the implementations in winit consistent?

MarijnS95 commented 11 months ago

In addition, what do folks think about having any of these features in the default set (e.g. the latest rwh_06)?

kchibisov commented 11 months ago

@MarijnS95 yes, just for consistency reasons. But I don't care that much if it's fine with you.

In addition, what do folks think about having any of these features in the default set (e.g. the latest rwh_06)?

Whatever you prefer as a library writer. You could suggest updating to 0.6.0 if you do breaking changes anyway.

MarijnS95 commented 11 months ago

@kchibisov added. I'll think about the default features for a bit... 0.5 used to be available OOTB so I feel like that "please upgrade" nudge might work if we provide 0.6 by default as well. default-features = false is pretty easy.