Update raw-window-handle to v0.5.0

This updates raw-window-handle to v0.5.0.
This commit is contained in:
Kirill Chibisov 2022-07-21 22:22:36 +03:00 committed by GitHub
parent 3e991e13dc
commit 653bc59813
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 177 additions and 56 deletions

View file

@ -17,6 +17,7 @@ use cocoa::{
foundation::{NSInteger, NSPoint, NSTimeInterval},
};
use objc::rc::autoreleasepool;
use raw_window_handle::{AppKitDisplayHandle, RawDisplayHandle};
use crate::{
event::Event,
@ -87,6 +88,11 @@ impl<T: 'static> EventLoopWindowTarget<T> {
let monitor = monitor::primary_monitor();
Some(RootMonitorHandle { inner: monitor })
}
#[inline]
pub fn raw_display_handle(&self) -> RawDisplayHandle {
RawDisplayHandle::AppKit(AppKitDisplayHandle::empty())
}
}
impl<T> EventLoopWindowTarget<T> {

View file

@ -1,4 +1,3 @@
use raw_window_handle::{AppKitHandle, RawWindowHandle};
use std::{
collections::VecDeque,
convert::TryInto,
@ -10,6 +9,10 @@ use std::{
},
};
use raw_window_handle::{
AppKitDisplayHandle, AppKitWindowHandle, RawDisplayHandle, RawWindowHandle,
};
use crate::{
dpi::{
LogicalPosition, LogicalSize, PhysicalPosition, PhysicalSize, Position, Size, Size::Logical,
@ -1144,10 +1147,15 @@ impl UnownedWindow {
#[inline]
pub fn raw_window_handle(&self) -> RawWindowHandle {
let mut handle = AppKitHandle::empty();
handle.ns_window = *self.ns_window as *mut _;
handle.ns_view = *self.ns_view as *mut _;
RawWindowHandle::AppKit(handle)
let mut window_handle = AppKitWindowHandle::empty();
window_handle.ns_window = *self.ns_window as *mut _;
window_handle.ns_view = *self.ns_view as *mut _;
RawWindowHandle::AppKit(window_handle)
}
#[inline]
pub fn raw_display_handle(&self) -> RawDisplayHandle {
RawDisplayHandle::AppKit(AppKitDisplayHandle::empty())
}
}