Browse Source

fix(windows): hide windows on cleanup (#9612)

* Hide windows on cleanup

* Add change file

* Move hide window to a loop above
Tony 1 year ago
parent
commit
6c047aee14
2 changed files with 9 additions and 2 deletions
  1. 5 0
      .changes/hide-windows-on-cleanup.md
  2. 4 2
      core/tauri/src/app.rs

+ 5 - 0
.changes/hide-windows-on-cleanup.md

@@ -0,0 +1,5 @@
+---
+"tauri": "patch:bug"
+---
+
+Fix window white flashing on exit on Windows

+ 4 - 2
core/tauri/src/app.rs

@@ -772,10 +772,12 @@ macro_rules! shared_app_impl {
         #[cfg(all(desktop, feature = "tray-icon"))]
         self.manager.tray.icons.lock().unwrap().clear();
         self.manager.resources_table().clear();
-        for (_, window) in self.manager.windows().iter() {
+        for (_, window) in self.manager.windows() {
           window.resources_table().clear();
+          #[cfg(windows)]
+          let _ = window.hide();
         }
-        for (_, webview) in self.manager.webviews().iter() {
+        for (_, webview) in self.manager.webviews() {
           webview.resources_table().clear();
         }
       }