gpui: Allow DisplayId to be compared to u32 (#27895)

allow DisplayId to be compared to u32. This is handy since gpui doesn't
provide a method to detect current active display of the user. So when
using mouse location to get the active display we need to then compare
that display u32 to DisplayID

Release Notes:
- added From to allow u32 comparison
This commit is contained in:
Terminal 2025-04-10 15:41:10 -05:00 committed by GitHub
parent 24d4f8ca18
commit 90f30b5c20
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -274,6 +274,12 @@ pub struct ScreenCaptureFrame(pub PlatformScreenCaptureFrame);
#[derive(PartialEq, Eq, Hash, Copy, Clone)]
pub struct DisplayId(pub(crate) u32);
impl From<DisplayId> for u32 {
fn from(id: DisplayId) -> Self {
id.0
}
}
impl Debug for DisplayId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "DisplayId({})", self.0)