Various Monitor/VideoModeHandle methods now return an Option
`VideoModeHandle::refresh_rate_millihertz()` and `bit_depth()` now return a `Option<NonZero*>`. `MonitorHandle::position()` now returns an `Option`. On Orbital `MonitorHandle::name()` now returns `None` instead of a dummy name.
This commit is contained in:
parent
0ffcfd8a3a
commit
58142680ce
15 changed files with 259 additions and 195 deletions
|
|
@ -1,3 +1,4 @@
|
|||
use std::num::NonZeroU16;
|
||||
use std::str::FromStr;
|
||||
use std::{env, str};
|
||||
|
||||
|
|
@ -86,7 +87,7 @@ impl XConnection {
|
|||
current: mode.id == current_mode,
|
||||
size: (mode.width.into(), mode.height.into()),
|
||||
refresh_rate_millihertz: monitor::mode_refresh_rate_millihertz(mode),
|
||||
bit_depth: bit_depth as u16,
|
||||
bit_depth: NonZeroU16::new(bit_depth as u16),
|
||||
native_mode: mode.id,
|
||||
// This is populated in `MonitorHandle::video_modes` as the
|
||||
// video mode is returned to the user
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue