From 01da5122315cc16141bf9bdff055e848de5aa47d Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Tue, 13 Oct 2020 23:02:30 +0200 Subject: [PATCH] Fix window startup closing --- src/app.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app.rs b/src/app.rs index ccb6f9f..df039d8 100644 --- a/src/app.rs +++ b/src/app.rs @@ -61,7 +61,7 @@ impl App { fn close_window(&mut self, window_name: &config::WindowName) -> Result<()> { let window = self .windows - .get(window_name) + .remove(window_name) .context(format!("No window with name '{}' is running.", window_name))?; window.close(); self.eww_state.clear_window_state(window_name); @@ -76,7 +76,7 @@ impl App { size: Option, ) -> Result<()> { // remove and close existing window of the same type - self.windows.remove(window_name).map(|window| window.close()); + let _ = self.close_window(window_name); let mut window_def = self .eww_config