Change Monitor dimensions functions to size functions (#911)

This commit is contained in:
Osspial 2019-06-13 02:33:44 -04:00 committed by Hal Gentz
parent 47b5dfa034
commit ea5c21950c
12 changed files with 34 additions and 34 deletions

View file

@ -70,7 +70,7 @@ impl MonitorHandle {
primary: bool,
) -> Option<Self> {
let (name, hidpi_factor, video_modes) = unsafe { xconn.get_output_info(resources, &repr)? };
let (dimensions, position) = unsafe { (repr.dimensions(), repr.position()) };
let (dimensions, position) = unsafe { (repr.size(), repr.position()) };
let rect = util::AaRect::new(position, dimensions);
Some(MonitorHandle {
id,
@ -93,7 +93,7 @@ impl MonitorHandle {
self.id as u32
}
pub fn dimensions(&self) -> PhysicalSize {
pub fn size(&self) -> PhysicalSize {
self.dimensions.into()
}

View file

@ -52,7 +52,7 @@ impl MonitorRepr {
}
}
pub unsafe fn dimensions(&self) -> (u32, u32) {
pub unsafe fn size(&self) -> (u32, u32) {
match *self {
MonitorRepr::Monitor(monitor) => ((*monitor).width as u32, (*monitor).height as u32),
MonitorRepr::Crtc(crtc) => ((*crtc).width as u32, (*crtc).height as u32),
@ -136,7 +136,7 @@ impl XConnection {
};
VideoMode {
dimensions: (x.width, x.height),
size: (x.width, x.height),
refresh_rate: (refresh_rate as f32 / 1000.0).round() as u16,
bit_depth: bit_depth as u16,
}
@ -151,7 +151,7 @@ impl XConnection {
dpi / 96.
} else {
calc_dpi_factor(
repr.dimensions(),
repr.size(),
((*output_info).mm_width as u64, (*output_info).mm_height as u64),
)
};