diff --git a/Cargo.lock b/Cargo.lock index dc35880f..e90210f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4961,7 +4961,7 @@ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "smithay" version = "0.7.0" -source = "git+https://github.com/smithay/smithay.git?rev=15e3fcd#15e3fcde99deb1adfab4c63be0a06783b780e963" +source = "git+https://github.com/smithay/smithay.git?rev=d40ada5#d40ada55eceac04fb1c752f0f17b0c32cf24fbb1" dependencies = [ "aliasable", "appendlist", diff --git a/Cargo.toml b/Cargo.toml index cee1f8bb..a2ae94f6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -145,4 +145,4 @@ cosmic-protocols = { git = "https://github.com/pop-os//cosmic-protocols", branch cosmic-client-toolkit = { git = "https://github.com/pop-os//cosmic-protocols", branch = "main" } [patch.crates-io] -smithay = { git = "https://github.com/smithay/smithay.git", rev = "15e3fcd" } +smithay = { git = "https://github.com/smithay/smithay.git", rev = "d40ada5" } diff --git a/src/shell/element/surface.rs b/src/shell/element/surface.rs index 098b386d..fb6c9ae2 100644 --- a/src/shell/element/surface.rs +++ b/src/shell/element/surface.rs @@ -416,8 +416,9 @@ impl CosmicSurface { .get_or_insert_threadsafe(Minimized::default) .0 .store(minimized, Ordering::SeqCst); - if !minimized { - if let WindowSurface::X11(surface) = self.0.underlying_surface() { + if let WindowSurface::X11(surface) = self.0.underlying_surface() { + let _ = surface.set_hidden(minimized); + if !minimized { let _ = surface.set_mapped(false); let _ = surface.set_mapped(true); } @@ -441,17 +442,14 @@ impl CosmicSurface { } pub fn set_suspended(&self, suspended: bool) { - match self.0.underlying_surface() { - WindowSurface::Wayland(window) => window.with_pending_state(|state| { + if let WindowSurface::Wayland(window) = self.0.underlying_surface() { + window.with_pending_state(|state| { if suspended { state.states.set(ToplevelState::Suspended); } else { state.states.unset(ToplevelState::Suspended); } - }), - WindowSurface::X11(surface) => { - let _ = surface.set_suspended(suspended); - } + }); } }