Fix fullscreen mode on glutin backend[ci skip]
This commit is contained in:
parent
f07228895c
commit
a5ed1a370e
|
@ -351,6 +351,18 @@ impl BackendEventLoop for GlutinEventLoop {
|
|||
}
|
||||
_ => (),
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "horizon")))]
|
||||
{
|
||||
if state_ref.settings.window_mode.get_glutin_fullscreen_type() != window.window().fullscreen() {
|
||||
let fullscreen_type = state_ref.settings.window_mode.get_glutin_fullscreen_type();
|
||||
let cursor_visible = state_ref.settings.window_mode.should_display_mouse_cursor();
|
||||
|
||||
window.window().set_fullscreen(fullscreen_type);
|
||||
|
||||
window.window().set_cursor_visible(cursor_visible);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -396,13 +396,14 @@ impl BackendEventLoop for SDL2EventLoop {
|
|||
let window = refs.window.window_mut();
|
||||
|
||||
let fullscreen_type = state.settings.window_mode.get_sdl2_fullscreen_type();
|
||||
let show_cursor = state.settings.window_mode.should_display_mouse_cursor();
|
||||
|
||||
window.set_fullscreen(fullscreen_type);
|
||||
window
|
||||
.subsystem()
|
||||
.sdl()
|
||||
.mouse()
|
||||
.show_cursor(state.settings.window_mode.should_display_mouse_cursor());
|
||||
.show_cursor(show_cursor);
|
||||
|
||||
refs.fullscreen_type = fullscreen_type;
|
||||
}
|
||||
|
|
|
@ -86,6 +86,14 @@ impl WindowMode {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "backend-glutin")]
|
||||
pub fn get_glutin_fullscreen_type(&self) -> Option<glutin::window::Fullscreen> {
|
||||
match self {
|
||||
WindowMode::Windowed => None,
|
||||
WindowMode::Fullscreen => Some(glutin::window::Fullscreen::Borderless(None)),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn should_display_mouse_cursor(&self) -> bool {
|
||||
match self {
|
||||
WindowMode::Windowed => true,
|
||||
|
|
Loading…
Reference in New Issue