Update blade with transparency and exclusive fullscreen fixes (#10880)
Release Notes: - N/A Picks up https://github.com/kvark/blade/pull/113 and a bunch of other fixes. Should prevent the exclusive full-screen on Vulkan - related to #9728 cc @kazatsuyu Note: this PR doesn't enable transparency, this is left to follow-up
This commit is contained in:
parent
06d2d9da5f
commit
53f67a8241
8 changed files with 104 additions and 129 deletions
|
@ -2,16 +2,14 @@ use std::any::Any;
|
|||
use std::cell::{Ref, RefCell, RefMut};
|
||||
use std::ffi::c_void;
|
||||
use std::num::NonZeroU32;
|
||||
use std::ptr::NonNull;
|
||||
use std::rc::{Rc, Weak};
|
||||
use std::sync::Arc;
|
||||
|
||||
use blade_graphics as gpu;
|
||||
use blade_rwh::{HasRawDisplayHandle, HasRawWindowHandle, RawDisplayHandle, RawWindowHandle};
|
||||
use collections::{HashMap, HashSet};
|
||||
use futures::channel::oneshot::Receiver;
|
||||
use raw_window_handle::{
|
||||
DisplayHandle, HandleError, HasDisplayHandle, HasWindowHandle, WindowHandle,
|
||||
};
|
||||
use raw_window_handle as rwh;
|
||||
use wayland_backend::client::ObjectId;
|
||||
use wayland_client::WEnum;
|
||||
use wayland_client::{protocol::wl_surface, Proxy};
|
||||
|
@ -49,19 +47,18 @@ struct RawWindow {
|
|||
display: *mut c_void,
|
||||
}
|
||||
|
||||
unsafe impl HasRawWindowHandle for RawWindow {
|
||||
fn raw_window_handle(&self) -> RawWindowHandle {
|
||||
let mut wh = blade_rwh::WaylandWindowHandle::empty();
|
||||
wh.surface = self.window;
|
||||
wh.into()
|
||||
impl rwh::HasWindowHandle for RawWindow {
|
||||
fn window_handle(&self) -> Result<rwh::WindowHandle<'_>, rwh::HandleError> {
|
||||
let window = NonNull::new(self.window).unwrap();
|
||||
let handle = rwh::WaylandWindowHandle::new(window);
|
||||
Ok(unsafe { rwh::WindowHandle::borrow_raw(handle.into()) })
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl HasRawDisplayHandle for RawWindow {
|
||||
fn raw_display_handle(&self) -> RawDisplayHandle {
|
||||
let mut dh = blade_rwh::WaylandDisplayHandle::empty();
|
||||
dh.display = self.display;
|
||||
dh.into()
|
||||
impl rwh::HasDisplayHandle for RawWindow {
|
||||
fn display_handle(&self) -> Result<rwh::DisplayHandle<'_>, rwh::HandleError> {
|
||||
let display = NonNull::new(self.display).unwrap();
|
||||
let handle = rwh::WaylandDisplayHandle::new(display);
|
||||
Ok(unsafe { rwh::DisplayHandle::borrow_raw(handle.into()) })
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -520,14 +517,13 @@ impl WaylandWindowStatePtr {
|
|||
}
|
||||
}
|
||||
|
||||
impl HasWindowHandle for WaylandWindow {
|
||||
fn window_handle(&self) -> Result<WindowHandle<'_>, HandleError> {
|
||||
impl rwh::HasWindowHandle for WaylandWindow {
|
||||
fn window_handle(&self) -> Result<rwh::WindowHandle<'_>, rwh::HandleError> {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
impl HasDisplayHandle for WaylandWindow {
|
||||
fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError> {
|
||||
impl rwh::HasDisplayHandle for WaylandWindow {
|
||||
fn display_handle(&self) -> Result<rwh::DisplayHandle<'_>, rwh::HandleError> {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue