mirror of
https://github.com/rust-windowing/winit.git
synced 2026-09-02 14:50:04 -04:00
fix broken / missing raw-window-handle implementation on android (#1258)
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
# Unreleased
|
# Unreleased
|
||||||
|
|
||||||
|
# Version 0.19.5 (2019-11-04)
|
||||||
|
|
||||||
|
- On Android, fix the missing `raw-window-handle` support
|
||||||
|
|
||||||
# Version 0.19.4 (2019-10-16)
|
# Version 0.19.4 (2019-10-16)
|
||||||
|
|
||||||
- Add support for `raw-window-handle` 0.3.
|
- Add support for `raw-window-handle` 0.3.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "winit"
|
name = "winit"
|
||||||
version = "0.19.4"
|
version = "0.19.5"
|
||||||
authors = ["The winit contributors", "Pierre Krieger <pierre.krieger1708@gmail.com>"]
|
authors = ["The winit contributors", "Pierre Krieger <pierre.krieger1708@gmail.com>"]
|
||||||
description = "Cross-platform window creation library."
|
description = "Cross-platform window creation library."
|
||||||
keywords = ["windowing"]
|
keywords = ["windowing"]
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Please direct all work against `master`.
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
winit = "0.19.4"
|
winit = "0.19.5"
|
||||||
```
|
```
|
||||||
|
|
||||||
## [Documentation](https://docs.rs/winit)
|
## [Documentation](https://docs.rs/winit)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ extern crate android_glue;
|
|||||||
|
|
||||||
mod ffi;
|
mod ffi;
|
||||||
|
|
||||||
|
use raw_window_handle::{android::AndroidHandle, RawWindowHandle};
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::collections::VecDeque;
|
use std::collections::VecDeque;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
@@ -422,6 +423,14 @@ impl Window {
|
|||||||
pub fn id(&self) -> WindowId {
|
pub fn id(&self) -> WindowId {
|
||||||
WindowId
|
WindowId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn raw_window_handle(&self) -> RawWindowHandle {
|
||||||
|
let handle = AndroidHandle {
|
||||||
|
a_native_window: self.native_window as _,
|
||||||
|
..AndroidHandle::empty()
|
||||||
|
};
|
||||||
|
RawWindowHandle::Android(handle)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl Send for Window {}
|
unsafe impl Send for Window {}
|
||||||
|
|||||||
Reference in New Issue
Block a user