Support listing available video modes for a monitor (#896)
* Support listing available video modes for a monitor * Use derivative for Windows `MonitorHandle` * Update FEATURES.md * Fix multiline if statement * Add documentation for `VideoMode` type
This commit is contained in:
parent
2b89ddec15
commit
47b5dfa034
13 changed files with 254 additions and 23 deletions
|
|
@ -14,7 +14,7 @@ use icon::Icon;
|
|||
use error::{ExternalError, NotSupportedError, OsError as RootOsError};
|
||||
use event::Event;
|
||||
use event_loop::{EventLoopClosed, ControlFlow, EventLoopWindowTarget as RootELW};
|
||||
use monitor::MonitorHandle as RootMonitorHandle;
|
||||
use monitor::{MonitorHandle as RootMonitorHandle, VideoMode};
|
||||
use window::{WindowAttributes, CursorIcon};
|
||||
use self::x11::{XConnection, XError};
|
||||
use self::x11::ffi::XVisualInfo;
|
||||
|
|
@ -142,6 +142,14 @@ impl MonitorHandle {
|
|||
&MonitorHandle::Wayland(ref m) => m.hidpi_factor() as f64,
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn video_modes(&self) -> Box<dyn Iterator<Item = VideoMode>> {
|
||||
match self {
|
||||
MonitorHandle::X(m) => Box::new(m.video_modes()),
|
||||
MonitorHandle::Wayland(m) => Box::new(m.video_modes()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Window {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue