From 90f30b5c200d56d3c3a5c601386ccb28964cb888 Mon Sep 17 00:00:00 2001 From: Terminal <32599364+TerminalFi@users.noreply.github.com> Date: Thu, 10 Apr 2025 15:41:10 -0500 Subject: [PATCH] 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 --- crates/gpui/src/platform.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/gpui/src/platform.rs b/crates/gpui/src/platform.rs index c118aa6249..4a6ebc92f8 100644 --- a/crates/gpui/src/platform.rs +++ b/crates/gpui/src/platform.rs @@ -274,6 +274,12 @@ pub struct ScreenCaptureFrame(pub PlatformScreenCaptureFrame); #[derive(PartialEq, Eq, Hash, Copy, Clone)] pub struct DisplayId(pub(crate) u32); +impl From 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)