Revert "Fix, windows display orders"

This commit is contained in:
RustDesk
2023-11-13 17:31:55 +08:00
committed by GitHub
parent 44e13c84bc
commit 627d21a00a
7 changed files with 26 additions and 55 deletions

View File

@@ -111,23 +111,16 @@ impl Display {
let tmp = Self::all_().unwrap_or(Default::default());
if tmp.is_empty() {
println!("Display got from gdi");
return Ok(Self::displays_from_dxgi_displays(
dxgi::Displays::get_from_gdi().drain(..),
));
return Ok(dxgi::Displays::get_from_gdi()
.drain(..)
.map(Display)
.collect::<Vec<_>>());
}
Ok(tmp)
}
#[inline]
pub fn displays_from_dxgi_displays<I>(displays: I) -> Vec<Display>
where
I: Iterator<Item = dxgi::Display>,
{
displays.map(Display).collect::<Vec<_>>()
}
fn all_() -> io::Result<Vec<Display>> {
Ok(Self::displays_from_dxgi_displays(dxgi::Displays::new()?))
Ok(dxgi::Displays::new()?.map(Display).collect::<Vec<_>>())
}
pub fn width(&self) -> usize {