Update raw-window-handle to v0.5.0
This updates raw-window-handle to v0.5.0.
This commit is contained in:
parent
3e991e13dc
commit
653bc59813
19 changed files with 177 additions and 56 deletions
|
|
@ -6,6 +6,8 @@ use std::process;
|
|||
use std::rc::Rc;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
use raw_window_handle::{RawDisplayHandle, WaylandDisplayHandle};
|
||||
|
||||
use sctk::reexports::client::protocol::wl_compositor::WlCompositor;
|
||||
use sctk::reexports::client::protocol::wl_shm::WlShm;
|
||||
use sctk::reexports::client::Display;
|
||||
|
|
@ -71,6 +73,14 @@ pub struct EventLoopWindowTarget<T> {
|
|||
_marker: std::marker::PhantomData<T>,
|
||||
}
|
||||
|
||||
impl<T> EventLoopWindowTarget<T> {
|
||||
pub fn raw_display_handle(&self) -> RawDisplayHandle {
|
||||
let mut display_handle = WaylandDisplayHandle::empty();
|
||||
display_handle.display = self.display.get_display_ptr() as *mut _;
|
||||
RawDisplayHandle::Wayland(display_handle)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct EventLoop<T: 'static> {
|
||||
/// Event loop.
|
||||
event_loop: calloop::EventLoop<'static, WinitState>,
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@ use sctk::reexports::client::Display;
|
|||
|
||||
use sctk::reexports::calloop;
|
||||
|
||||
use raw_window_handle::WaylandHandle;
|
||||
use raw_window_handle::{
|
||||
RawDisplayHandle, RawWindowHandle, WaylandDisplayHandle, WaylandWindowHandle,
|
||||
};
|
||||
use sctk::window::Decorations;
|
||||
|
||||
use crate::dpi::{LogicalSize, PhysicalPosition, PhysicalSize, Position, Size};
|
||||
|
|
@ -579,11 +581,17 @@ impl Window {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn raw_window_handle(&self) -> WaylandHandle {
|
||||
let mut handle = WaylandHandle::empty();
|
||||
handle.display = self.display.get_display_ptr() as *mut _;
|
||||
handle.surface = self.surface.as_ref().c_ptr() as *mut _;
|
||||
handle
|
||||
pub fn raw_window_handle(&self) -> RawWindowHandle {
|
||||
let mut window_handle = WaylandWindowHandle::empty();
|
||||
window_handle.surface = self.surface.as_ref().c_ptr() as *mut _;
|
||||
RawWindowHandle::Wayland(window_handle)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn raw_display_handle(&self) -> RawDisplayHandle {
|
||||
let mut display_handle = WaylandDisplayHandle::empty();
|
||||
display_handle.display = self.display.get_display_ptr() as *mut _;
|
||||
RawDisplayHandle::Wayland(display_handle)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue