diff options
author | 2022-07-18 18:37:41 +0200 | |
---|---|---|
committer | 2022-08-18 14:09:20 +0200 | |
commit | 277b848ad8df1e8d038e33707548a45d63a601db (patch) | |
tree | 1da6c7a5135fb5f5c40a237224daae3721b2f685 /winit/src/application/state.rs | |
parent | 07cbed106467097543ff33d3b34e0e1ca6f695ae (diff) | |
download | iced-277b848ad8df1e8d038e33707548a45d63a601db.tar.gz iced-277b848ad8df1e8d038e33707548a45d63a601db.tar.bz2 iced-277b848ad8df1e8d038e33707548a45d63a601db.zip |
Remove `window::Mode` and introduce `Settings::visible`
Additionally, only show the window once one frame has been rendered to avoid blank flashes on Windows.
Diffstat (limited to 'winit/src/application/state.rs')
-rw-r--r-- | winit/src/application/state.rs | 19 |
1 files changed, 1 insertions, 18 deletions
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 <A::Renderer as crate::Renderer>::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(); |