I switched `vsyncstart` and `vdisplay` again, as per the discussion on
issue #582.
This commit is contained in:
Adam Badawy 2015-10-25 21:47:47 -04:00
parent 188b8f5c08
commit 918dc67992

View file

@ -325,7 +325,7 @@ impl Window {
let mode_to_switch_to = if window_attrs.monitor.is_some() { let mode_to_switch_to = if window_attrs.monitor.is_some() {
let matching_mode = (0 .. mode_num).map(|i| { let matching_mode = (0 .. mode_num).map(|i| {
let m: ffi::XF86VidModeModeInfo = ptr::read(*modes.offset(i as isize) as *const _); m let m: ffi::XF86VidModeModeInfo = ptr::read(*modes.offset(i as isize) as *const _); m
}).find(|m| m.hdisplay == dimensions.0 as u16 && m.vsyncstart == dimensions.1 as u16); }).find(|m| m.hdisplay == dimensions.0 as u16 && m.vdisplay == dimensions.1 as u16);
if let Some(matching_mode) = matching_mode { if let Some(matching_mode) = matching_mode {
Some(matching_mode) Some(matching_mode)
@ -333,7 +333,7 @@ impl Window {
} else { } else {
let m = (0 .. mode_num).map(|i| { let m = (0 .. mode_num).map(|i| {
let m: ffi::XF86VidModeModeInfo = ptr::read(*modes.offset(i as isize) as *const _); m let m: ffi::XF86VidModeModeInfo = ptr::read(*modes.offset(i as isize) as *const _); m
}).find(|m| m.hdisplay >= dimensions.0 as u16 && m.vsyncstart == dimensions.1 as u16); }).find(|m| m.hdisplay >= dimensions.0 as u16 && m.vdisplay == dimensions.1 as u16);
match m { match m {
Some(m) => Some(m), Some(m) => Some(m),