mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
Fix, windows display orders
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -111,16 +111,23 @@ impl Display {
|
||||
let tmp = Self::all_().unwrap_or(Default::default());
|
||||
if tmp.is_empty() {
|
||||
println!("Display got from gdi");
|
||||
return Ok(dxgi::Displays::get_from_gdi()
|
||||
.drain(..)
|
||||
.map(Display)
|
||||
.collect::<Vec<_>>());
|
||||
return Ok(Self::displays_from_dxgi_displays(
|
||||
dxgi::Displays::get_from_gdi().drain(..),
|
||||
));
|
||||
}
|
||||
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(dxgi::Displays::new()?.map(Display).collect::<Vec<_>>())
|
||||
Ok(Self::displays_from_dxgi_displays(dxgi::Displays::new()?))
|
||||
}
|
||||
|
||||
pub fn width(&self) -> usize {
|
||||
|
||||
Reference in New Issue
Block a user