Add refresh_rate_millihertz for MonitorHandle
This also alters `VideoMode::refresh_rate` to `VideoMode::refresh_rate_millihertz` which now returns monitor refresh rate in mHz.
This commit is contained in:
parent
e289f30e5d
commit
a06bb3f992
11 changed files with 172 additions and 81 deletions
|
|
@ -256,6 +256,11 @@ impl MonitorHandle {
|
|||
x11_or_wayland!(match self; MonitorHandle(m) => m.position())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn refresh_rate_millihertz(&self) -> Option<u32> {
|
||||
x11_or_wayland!(match self; MonitorHandle(m) => m.refresh_rate_millihertz())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn scale_factor(&self) -> f64 {
|
||||
x11_or_wayland!(match self; MonitorHandle(m) => m.scale_factor() as f64)
|
||||
|
|
@ -287,8 +292,8 @@ impl VideoMode {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn refresh_rate(&self) -> u16 {
|
||||
x11_or_wayland!(match self; VideoMode(m) => m.refresh_rate())
|
||||
pub fn refresh_rate_millihertz(&self) -> u32 {
|
||||
x11_or_wayland!(match self; VideoMode(m) => m.refresh_rate_millihertz())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue