Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

gpui: Implement `HasWindowHandle` on `Window` (#24327)

Amr Bashir4270f89956b5
diff --git a/crates/gpui/src/window.rs b/crates/gpui/src/window.rs
index e0e473974db..7639f5e676c 100644
--- a/crates/gpui/src/window.rs
+++ b/crates/gpui/src/window.rs
@@ -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