gpui: Implement window_handle and display_handle for wayland platform (#28152)

This PR implements the previously unimplemented window_handle and
display_handle methods in the wayland platform. It also exposes the
display_handle method through the Window struct.

Release Notes:

- N/A
This commit is contained in:
Christian Bergschneider 2025-05-31 00:45:03 +02:00 committed by GitHub
parent fe1b36671d
commit 40c91d5df0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 29 additions and 3 deletions

View file

@ -25,7 +25,7 @@ use derive_more::{Deref, DerefMut};
use futures::FutureExt;
use futures::channel::oneshot;
use parking_lot::RwLock;
use raw_window_handle::{HandleError, HasWindowHandle};
use raw_window_handle::{HandleError, HasDisplayHandle, HasWindowHandle};
use refineable::Refineable;
use slotmap::SlotMap;
use smallvec::SmallVec;
@ -4428,6 +4428,14 @@ impl HasWindowHandle for Window {
}
}
impl HasDisplayHandle for Window {
fn display_handle(
&self,
) -> std::result::Result<raw_window_handle::DisplayHandle<'_>, HandleError> {
self.platform_window.display_handle()
}
}
/// An identifier for an [`Element`](crate::Element).
///
/// Can be constructed with a string, a number, or both, as well