mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-12 05:31:31 +11:00
Use mode when switching to fullscreen
This commit is contained in:
parent
4f8095816e
commit
f9929fab2f
|
@ -435,16 +435,6 @@ impl Window {
|
||||||
window_attributes |= ffi::CWBackPixel;
|
window_attributes |= ffi::CWBackPixel;
|
||||||
}
|
}
|
||||||
|
|
||||||
// switching to fullscreen
|
|
||||||
// if let Some(mut mode_to_switch_to) = mode_to_switch_to {
|
|
||||||
// window_attributes |= ffi::CWOverrideRedirect;
|
|
||||||
// unsafe {
|
|
||||||
// (display.xf86vmode.XF86VidModeSwitchToMode)(display.display, screen_id, &mut mode_to_switch_to);
|
|
||||||
// (display.xf86vmode.XF86VidModeSetViewPort)(display.display, screen_id, 0, 0);
|
|
||||||
// set_win_attr.override_redirect = 1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// finally creating the window
|
// finally creating the window
|
||||||
let window = unsafe {
|
let window = unsafe {
|
||||||
let win = (display.xlib.XCreateWindow)(display.display, root, 0, 0, dimensions.0 as libc::c_uint,
|
let win = (display.xlib.XCreateWindow)(display.display, root, 0, 0, dimensions.0 as libc::c_uint,
|
||||||
|
@ -571,6 +561,22 @@ impl Window {
|
||||||
&mut x_event as *mut _
|
&mut x_event as *mut _
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(mut mode_to_switch_to) = mode_to_switch_to {
|
||||||
|
unsafe {
|
||||||
|
(display.xf86vmode.XF86VidModeSwitchToMode)(
|
||||||
|
display.display,
|
||||||
|
screen_id,
|
||||||
|
&mut mode_to_switch_to
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
println!("[glutin] Unexpected state: `mode` is None creating fullscreen window");
|
||||||
|
}
|
||||||
|
unsafe {
|
||||||
|
(display.xf86vmode.XF86VidModeSetViewPort)(display.display, screen_id, 0, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// finish creating the OpenGL context
|
// finish creating the OpenGL context
|
||||||
|
|
Loading…
Reference in a new issue