Add MonitorHandle::current_video_mode()

This commit is contained in:
daxpedda 2024-07-21 00:01:43 +02:00
parent 1168cd4113
commit 2e53533cc1
No known key found for this signature in database
GPG key ID: 43D62A3EA388E46F
12 changed files with 167 additions and 79 deletions

View file

@ -261,6 +261,11 @@ impl MonitorHandle {
x11_or_wayland!(match self; MonitorHandle(m) => m.scale_factor() as _)
}
#[inline]
pub fn current_video_mode(&self) -> Option<VideoModeHandle> {
x11_or_wayland!(match self; MonitorHandle(m) => m.current_video_mode())
}
#[inline]
pub fn video_modes(&self) -> Box<dyn Iterator<Item = VideoModeHandle>> {
x11_or_wayland!(match self; MonitorHandle(m) => Box::new(m.video_modes()))