From 277b848ad8df1e8d038e33707548a45d63a601db Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 18 Jul 2022 18:37:41 +0200 Subject: Remove `window::Mode` and introduce `Settings::visible` Additionally, only show the window once one frame has been rendered to avoid blank flashes on Windows. --- winit/src/application/state.rs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'winit/src/application/state.rs') diff --git a/winit/src/application/state.rs b/winit/src/application/state.rs index 6b843919..5e953cb5 100644 --- a/winit/src/application/state.rs +++ b/winit/src/application/state.rs @@ -1,6 +1,6 @@ use crate::application::{self, StyleSheet as _}; use crate::conversion; -use crate::{Application, Color, Debug, Mode, Point, Size, Viewport}; +use crate::{Application, Color, Debug, Point, Size, Viewport}; use std::marker::PhantomData; use winit::event::{Touch, WindowEvent}; @@ -13,7 +13,6 @@ where ::Theme: application::StyleSheet, { title: String, - mode: Mode, scale_factor: f64, viewport: Viewport, viewport_version: usize, @@ -31,7 +30,6 @@ where /// Creates a new [`State`] for the provided [`Application`] and window. pub fn new(application: &A, window: &Window) -> Self { let title = application.title(); - let mode = application.mode(); let scale_factor = application.scale_factor(); let theme = application.theme(); let appearance = theme.appearance(application.style()); @@ -47,7 +45,6 @@ where Self { title, - mode, scale_factor, viewport, viewport_version: 0, @@ -193,20 +190,6 @@ where self.title = new_title; } - // Update window mode - let new_mode = application.mode(); - - if self.mode != new_mode { - window.set_fullscreen(conversion::fullscreen( - window.current_monitor(), - new_mode, - )); - - window.set_visible(conversion::visible(new_mode)); - - self.mode = new_mode; - } - // Update scale factor let new_scale_factor = application.scale_factor(); -- cgit