diff --git a/cosmic-panel-bin/src/space/layout.rs b/cosmic-panel-bin/src/space/layout.rs index 30717ea..e55667d 100644 --- a/cosmic-panel-bin/src/space/layout.rs +++ b/cosmic-panel-bin/src/space/layout.rs @@ -712,6 +712,7 @@ impl PanelSpace { }) }) || self.animate_state.as_ref().is_some() || self.transitioning + || self.is_background_dirty { self.transitioning = false; if let Some(bg) = self.background_element.take() { @@ -795,6 +796,7 @@ impl PanelSpace { (loc[0] as i32, loc[1] as i32), false, ); + self.is_background_dirty = false; } input_region.subtract(0, 0, i32::MAX, i32::MAX); let anim_gap = self.anchor_gap; diff --git a/cosmic-panel-bin/src/space/panel_space.rs b/cosmic-panel-bin/src/space/panel_space.rs index 3c87059..415b66d 100644 --- a/cosmic-panel-bin/src/space/panel_space.rs +++ b/cosmic-panel-bin/src/space/panel_space.rs @@ -365,6 +365,7 @@ pub struct PanelSpace { pub overflow_popup: Option<(PanelPopup, OverflowSection)>, pub remap_attempts: u32, pub background_element: Option, + pub is_background_dirty: bool, pub last_minimize_update: Instant, pub(crate) minimized_toplevels: HashSet, pub(crate) toplevel_overlaps: HashSet, @@ -440,6 +441,7 @@ impl PanelSpace { overflow_popup: None, remap_attempts: 0, background_element: None, + is_background_dirty: false, last_minimize_update: Instant::now() - Duration::from_secs(1), anchor_gap: 0, notification_subscription: None, @@ -485,6 +487,7 @@ impl PanelSpace { pub fn apply_layer_overlaps(&mut self) { self.is_dirty = true; + self.is_background_dirty = true; self.logical_layer_start_overlap = 0; self.logical_layer_end_overlap = 0; for rect in self.layer_overlaps.values() {