Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/tomaka/winit
Browse files Browse the repository at this point in the history
  • Loading branch information
Osspial committed Oct 3, 2019
2 parents 4da8f46 + 5ced36e commit de2e531
Show file tree
Hide file tree
Showing 10 changed files with 289 additions and 25 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
- On X11, return dummy monitor data to avoid panicking when no monitors exist.
- On X11, prevent stealing input focus when creating a new window.
Only steal input focus when entering fullscreen mode.
- On Wayland, add support for set_cursor_visible and set_cursor_grab.
- On Wayland, fixed DeviceEvents for relative mouse movement is not always produced
- On Wayland, add support for set_cursor_icon.

# 0.20.0 Alpha 3 (2019-08-14)

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ libc = "0.2"
log = "0.4"
serde = { version = "1", optional = true, features = ["serde_derive"] }
derivative = "1.0.2"
raw-window-handle = "0.1"
raw-window-handle = "0.2"

[dev-dependencies]
image = "0.21"
Expand Down
4 changes: 2 additions & 2 deletions FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ Legend:
|----------------------- | ----- | ---- | ------- | ----------- | ----- | ----- | -------- |
|Mouse events |✔️ |[#63] |✔️ |✔️ |**N/A**|**N/A**||
|Mouse set location |✔️ |✔️ |✔️ ||**N/A**|**N/A**||
|Cursor grab |✔️ |[#165] |[#242] |[#306] |**N/A**|**N/A**||
|Cursor icon |✔️ |✔️ |✔️ |[#306] |**N/A**|**N/A**||
|Cursor grab |✔️ |[#165] |[#242] |✔️ |**N/A**|**N/A**||
|Cursor icon |✔️ |✔️ |✔️ |✔️ |**N/A**|**N/A**||
|Touch events |✔️ ||✔️ |✔️ |✔️ |✔️ ||
|Touch pressure |✔️ |||||✔️ ||
|Multitouch |✔️ ||✔️ |✔️ ||✔️ ||
Expand Down
10 changes: 10 additions & 0 deletions src/platform_impl/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use crate::{
CreationError, CursorIcon, Event, LogicalPosition, LogicalSize, PhysicalPosition, PhysicalSize,
WindowAttributes, WindowEvent, WindowId as RootWindowId,
};
use raw_window_handle::{android::AndroidHandle, RawWindowHandle};
use CreationError::OsError;

pub type OsError = std::io::Error;
Expand Down Expand Up @@ -421,6 +422,15 @@ impl Window {
pub fn id(&self) -> WindowId {
WindowId
}

#[inline]
pub fn raw_window_handle(&self) -> RawWindowHandle {
let handle = AndroidHandle {
a_native_window: self.native_window,
..WindowsHandle::empty()
};
RawWindowHandle::Android(handle)
}
}

unsafe impl Send for Window {}
Expand Down
2 changes: 1 addition & 1 deletion src/platform_impl/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ impl Window {

pub fn raw_window_handle(&self) -> RawWindowHandle {
match self {
&Window::X(ref window) => RawWindowHandle::X11(window.raw_window_handle()),
&Window::X(ref window) => RawWindowHandle::Xlib(window.raw_window_handle()),
&Window::Wayland(ref window) => RawWindowHandle::Wayland(window.raw_window_handle()),
}
}
Expand Down
Loading

0 comments on commit de2e531

Please sign in to comment.