From a97a1917dc21cdb5a39ad42c58ea8d1ee566ddf0 Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Sat, 23 Dec 2023 22:49:56 +0000 Subject: [PATCH] shell: fix fullscreening tiled windows --- src/shell/mod.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/shell/mod.rs b/src/shell/mod.rs index cfb5d2e5..ea476252 100644 --- a/src/shell/mod.rs +++ b/src/shell/mod.rs @@ -2615,20 +2615,22 @@ impl Shell { } pub fn maximize_request(&mut self, mapped: &CosmicMapped) { - let (managed_layer, floating_layer) = if let Some(set) = self + let (original_layer, floating_layer, original_geometry) = if let Some(set) = self .workspaces .sets .values_mut() .find(|set| set.sticky_layer.mapped().any(|m| m == mapped)) { - (ManagedLayer::Sticky, &mut set.sticky_layer) + let geometry = set.sticky_layer.element_geometry(mapped).unwrap(); + (ManagedLayer::Sticky, &mut set.sticky_layer, geometry) } else if let Some(workspace) = self.space_for_mut(&mapped) { let layer = if workspace.is_floating(&mapped) { ManagedLayer::Floating } else { ManagedLayer::Tiling }; - (layer, &mut workspace.floating_layer) + let geometry = workspace.element_geometry(mapped).unwrap(); + (layer, &mut workspace.floating_layer, geometry) } else { return; }; @@ -2636,8 +2638,8 @@ impl Shell { let mut state = mapped.maximized_state.lock().unwrap(); if state.is_none() { *state = Some(MaximizedState { - original_geometry: floating_layer.element_geometry(&mapped).unwrap(), - original_layer: managed_layer, + original_geometry, + original_layer, }); std::mem::drop(state); floating_layer.map_maximized(mapped.clone());