gpui: Implement HasWindowHandle
on Window
(#24327)
Implement `raw_window_handle::HasWindowHandle` for `gpui::Window` This opens a lot of possibility of using gpui with platform specific APIs. Edit: With this exposed, we can use crates like `window-vibrancy`, `muda` (menus crate) or even use `wry` (a webview renderer) to create a child `WebView` inside the gpui window. Release Notes: - N/A
This commit is contained in:
parent
0a70627f00
commit
4270f89956
1 changed files with 7 additions and 0 deletions
|
@ -23,6 +23,7 @@ use futures::FutureExt;
|
|||
#[cfg(target_os = "macos")]
|
||||
use media::core_video::CVImageBuffer;
|
||||
use parking_lot::RwLock;
|
||||
use raw_window_handle::{HandleError, HasWindowHandle};
|
||||
use refineable::Refineable;
|
||||
use slotmap::SlotMap;
|
||||
use smallvec::SmallVec;
|
||||
|
@ -3943,6 +3944,12 @@ impl AnyWindowHandle {
|
|||
}
|
||||
}
|
||||
|
||||
impl HasWindowHandle for Window {
|
||||
fn window_handle(&self) -> Result<raw_window_handle::WindowHandle<'_>, HandleError> {
|
||||
self.platform_window.window_handle()
|
||||
}
|
||||
}
|
||||
|
||||
/// An identifier for an [`Element`](crate::Element).
|
||||
///
|
||||
/// Can be constructed with a string, a number, or both, as well
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue