From 7ec474730478749530bbac7e7c90ecc8c64f4748 Mon Sep 17 00:00:00 2001
From: Wyatt Herkamp <wherkamp@kingtux.me>
Date: Mon, 15 Aug 2022 08:10:28 -0400
Subject: Update `winit` and `glutin` forks

---
 glutin/Cargo.toml             | 4 ++--
 glutin/src/application.rs     | 8 ++++----
 winit/Cargo.toml              | 6 +++---
 winit/src/application.rs      | 8 ++++----
 winit/src/settings.rs         | 2 +-
 winit/src/settings/windows.rs | 2 +-
 6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/glutin/Cargo.toml b/glutin/Cargo.toml
index 5ad038c0..d84f9d70 100644
--- a/glutin/Cargo.toml
+++ b/glutin/Cargo.toml
@@ -18,9 +18,9 @@ system = ["iced_winit/system"]
 version = "0.4"
 
 [dependencies.glutin]
-version = "0.28"
+version = "0.29"
 git = "https://github.com/iced-rs/glutin"
-rev = "7a0ee02782eb2bf059095e0c953c4bb53f1eef0e"
+rev = "da8d291486b4c9bec12487a46c119c4b1d386abf"
 
 [dependencies.iced_native]
 version = "0.5"
diff --git a/glutin/src/application.rs b/glutin/src/application.rs
index c6bb3e48..f474cbba 100644
--- a/glutin/src/application.rs
+++ b/glutin/src/application.rs
@@ -31,14 +31,14 @@ where
 {
     use futures::task;
     use futures::Future;
-    use glutin::event_loop::EventLoop;
+    use glutin::event_loop::EventLoopBuilder;
     use glutin::platform::run_return::EventLoopExtRunReturn;
     use glutin::ContextBuilder;
 
     let mut debug = Debug::new();
     debug.startup_started();
 
-    let mut event_loop = EventLoop::with_user_event();
+    let mut event_loop = EventLoopBuilder::with_user_event().build();
     let proxy = event_loop.create_proxy();
 
     let runtime = {
@@ -139,10 +139,10 @@ where
 
     let mut context = task::Context::from_waker(task::noop_waker_ref());
 
-    event_loop.run_return(move |event, _, control_flow| {
+    let _ = event_loop.run_return(move |event, _, control_flow| {
         use glutin::event_loop::ControlFlow;
 
-        if let ControlFlow::Exit = control_flow {
+        if let ControlFlow::ExitWithCode(_) = control_flow {
             return;
         }
 
diff --git a/winit/Cargo.toml b/winit/Cargo.toml
index 3b9ae859..f66b92fa 100644
--- a/winit/Cargo.toml
+++ b/winit/Cargo.toml
@@ -20,9 +20,9 @@ log = "0.4"
 thiserror = "1.0"
 
 [dependencies.winit]
-version = "0.26"
-git = "https://github.com/iced-rs/winit"
-rev = "02a12380960cec2f351c09a33d6a7cc2789d96a6"
+version = "0.27"
+git = "https://github.com/iced-rs/winit.git"
+rev = "940457522e9fb9f5dac228b0ecfafe0138b4048c"
 
 [dependencies.iced_native]
 version = "0.5"
diff --git a/winit/src/application.rs b/winit/src/application.rs
index a576126e..13efd971 100644
--- a/winit/src/application.rs
+++ b/winit/src/application.rs
@@ -116,12 +116,12 @@ where
 {
     use futures::task;
     use futures::Future;
-    use winit::event_loop::EventLoop;
+    use winit::event_loop::EventLoopBuilder;
 
     let mut debug = Debug::new();
     debug.startup_started();
 
-    let event_loop = EventLoop::with_user_event();
+    let event_loop = EventLoopBuilder::with_user_event().build();
     let proxy = event_loop.create_proxy();
 
     let runtime = {
@@ -186,7 +186,7 @@ where
     platform::run(event_loop, move |event, _, control_flow| {
         use winit::event_loop::ControlFlow;
 
-        if let ControlFlow::Exit = control_flow {
+        if let ControlFlow::ExitWithCode(_) = control_flow {
             return;
         }
 
@@ -713,7 +713,7 @@ mod platform {
     {
         use winit::platform::run_return::EventLoopExtRunReturn;
 
-        event_loop.run_return(event_handler);
+        let _ = event_loop.run_return(event_handler);
 
         Ok(())
     }
diff --git a/winit/src/settings.rs b/winit/src/settings.rs
index a04ec863..6387454b 100644
--- a/winit/src/settings.rs
+++ b/winit/src/settings.rs
@@ -138,7 +138,7 @@ impl Window {
             use ::winit::platform::unix::WindowBuilderExtUnix;
 
             if let Some(id) = _id {
-                window_builder = window_builder.with_app_id(id);
+                window_builder = window_builder.with_name(id.clone(), id);
             }
         }
 
diff --git a/winit/src/settings/windows.rs b/winit/src/settings/windows.rs
index fc26acd7..9bef1eaf 100644
--- a/winit/src/settings/windows.rs
+++ b/winit/src/settings/windows.rs
@@ -5,7 +5,7 @@
 #[derive(Debug, Clone, Copy, PartialEq, Eq)]
 pub struct PlatformSpecific {
     /// Parent window
-    pub parent: Option<winapi::shared::windef::HWND>,
+    pub parent: Option<winit::platform::windows::HWND>,
 
     /// Drag and drop support
     pub drag_and_drop: bool,
-- 
cgit 


From 28a30079d1b583fa62b1c48c90cdb8906923fed6 Mon Sep 17 00:00:00 2001
From: Héctor Ramón Jiménez <hector0193@gmail.com>
Date: Mon, 29 Aug 2022 14:24:03 +0200
Subject: Return `Mode::Hidden` in `window::Action::FetchMode`

... when the window is not visible.
---
 winit/src/application.rs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/winit/src/application.rs b/winit/src/application.rs
index 13efd971..0496aea9 100644
--- a/winit/src/application.rs
+++ b/winit/src/application.rs
@@ -635,7 +635,11 @@ pub fn run_command<A, E>(
                     ));
                 }
                 window::Action::FetchMode(tag) => {
-                    let mode = conversion::mode(window.fullscreen());
+                    let mode = if window.is_visible().unwrap_or(true) {
+                        conversion::mode(window.fullscreen())
+                    } else {
+                        window::Mode::Hidden
+                    };
 
                     proxy
                         .send_event(tag(mode))
-- 
cgit