Skip to content

Commit

Permalink
Update raw-window-handle to 0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Nov 27, 2021
1 parent 29a078f commit e6ba71d
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 18 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Unreleased

- Update `raw-window-handle` to `0.4.1`. This is _not_ a breaking change, we still implement `HasRawWindowHandle` from version `0.3`, see [rust-windowing/raw-window-handle#74](https://github.com/rust-windowing/raw-window-handle/pull/74).
- On X11, bump `mio` to 0.8.
- On Android, fixed `WindowExtAndroid::config` initially returning an empty `Configuration`.
- On Android, fixed `Window::scale_factor` and `MonitorHandle::scale_factor` initially always returning 1.0.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ instant = { version = "0.1", features = ["wasm-bindgen"] }
lazy_static = "1"
log = "0.4"
serde = { version = "1", optional = true, features = ["serde_derive"] }
raw-window-handle = "0.3"
raw-window-handle = "0.4.1"
bitflags = "1"
mint = { version = "0.5.6", optional = true }

Expand Down
4 changes: 2 additions & 2 deletions src/platform_impl/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,9 +595,9 @@ impl Window {
} else {
panic!("Cannot get the native window, it's null and will always be null before Event::Resumed and after Event::Suspended. Make sure you only call this function between those events.");
};
let mut handle = raw_window_handle::android::AndroidHandle::empty();
let mut handle = raw_window_handle::AndroidNdkHandle::empty();
handle.a_native_window = a_native_window;
raw_window_handle::RawWindowHandle::Android(handle)
raw_window_handle::RawWindowHandle::AndroidNdk(handle)
}

pub fn config(&self) -> Configuration {
Expand Down
8 changes: 4 additions & 4 deletions src/platform_impl/ios/window.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use raw_window_handle::{ios::IOSHandle, RawWindowHandle};
use raw_window_handle::{UiKitHandle, RawWindowHandle};
use std::{
collections::VecDeque,
ops::{Deref, DerefMut},
Expand Down Expand Up @@ -307,13 +307,13 @@ impl Inner {
}

pub fn raw_window_handle(&self) -> RawWindowHandle {
let handle = IOSHandle {
let handle = UiKitHandle {
ui_window: self.window as _,
ui_view: self.view as _,
ui_view_controller: self.view_controller as _,
..IOSHandle::empty()
..UiKitHandle::empty()
};
RawWindowHandle::IOS(handle)
RawWindowHandle::UiKit(handle)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/platform_impl/linux/wayland/window/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use sctk::reexports::client::Display;

use sctk::reexports::calloop;

use raw_window_handle::unix::WaylandHandle;
use raw_window_handle::WaylandHandle;
use sctk::window::{Decorations, FallbackFrame};

use crate::dpi::{LogicalSize, PhysicalPosition, PhysicalSize, Position, Size};
Expand Down
2 changes: 1 addition & 1 deletion src/platform_impl/linux/x11/window.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use raw_window_handle::unix::XlibHandle;
use raw_window_handle::XlibHandle;
use std::{
cmp, env,
ffi::CString,
Expand Down
8 changes: 4 additions & 4 deletions src/platform_impl/macos/window.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use raw_window_handle::{macos::MacOSHandle, RawWindowHandle};
use raw_window_handle::{AppKitHandle, RawWindowHandle};
use std::{
collections::VecDeque,
f64,
Expand Down Expand Up @@ -1059,12 +1059,12 @@ impl UnownedWindow {

#[inline]
pub fn raw_window_handle(&self) -> RawWindowHandle {
let handle = MacOSHandle {
let handle = AppKitHandle {
ns_window: *self.ns_window as *mut _,
ns_view: *self.ns_view as *mut _,
..MacOSHandle::empty()
..AppKitHandle::empty()
};
RawWindowHandle::MacOS(handle)
RawWindowHandle::AppKit(handle)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/platform_impl/web/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::window::{
CursorIcon, Fullscreen, UserAttentionType, WindowAttributes, WindowId as RootWI,
};

use raw_window_handle::web::WebHandle;
use raw_window_handle::WebHandle;

use super::{backend, monitor, EventLoopWindowTarget};

Expand Down
8 changes: 4 additions & 4 deletions src/platform_impl/windows/window.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![cfg(target_os = "windows")]

use parking_lot::Mutex;
use raw_window_handle::{windows::WindowsHandle, RawWindowHandle};
use raw_window_handle::{Win32Handle, RawWindowHandle};
use std::{
cell::Cell,
ffi::OsStr,
Expand Down Expand Up @@ -233,12 +233,12 @@ impl Window {

#[inline]
pub fn raw_window_handle(&self) -> RawWindowHandle {
let handle = WindowsHandle {
let handle = Win32Handle {
hwnd: self.window.0 as *mut _,
hinstance: self.hinstance() as *mut _,
..WindowsHandle::empty()
..Win32Handle::empty()
};
RawWindowHandle::Windows(handle)
RawWindowHandle::Win32(handle)
}

#[inline]
Expand Down

0 comments on commit e6ba71d

Please sign in to comment.