Skip to content

Commit c86bcb3

Browse files
committed
fix: theme error handling improvements
1 parent b0c02aa commit c86bcb3

4 files changed

Lines changed: 35 additions & 22 deletions

File tree

Cargo.lock

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cosmic-panel-bin/src/space/panel_space.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ impl PanelSpace {
406406
let name = format!("{}-{}", config.name, config.output);
407407
let visibility =
408408
if config.autohide.is_some() { Visibility::Hidden } else { Visibility::Visible };
409-
Self {
409+
let s = Self {
410410
config,
411411
shared: shared.clone(),
412412
space: Space::default(),
@@ -479,7 +479,8 @@ impl PanelSpace {
479479
compositor_state: None,
480480
corner_radius_manager: corner_radius_manager.cloned(),
481481
corner_radius_wlr: None,
482-
}
482+
};
483+
s
483484
}
484485

485486
pub fn has_toplevel_overlap(&self) -> bool {

cosmic-panel-bin/src/space_container/space_container.rs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,26 @@ impl SpaceContainer {
7979

8080
let light = Theme::light_config()
8181
.ok()
82-
.and_then(|c| Theme::get_entry(&c).ok())
82+
.map(|c| {
83+
Theme::get_entry(&c).unwrap_or_else(|e| {
84+
for e in e.0 {
85+
tracing::warn!("Error loading light theme: {e:?}");
86+
}
87+
e.1
88+
})
89+
})
8390
.unwrap_or_else(Theme::light_default);
8491
let dark = Theme::dark_config()
8592
.ok()
86-
.and_then(|c| Theme::get_entry(&c).ok())
93+
.map(|c| {
94+
Theme::get_entry(&c).unwrap_or_else(|e| {
95+
for e in e.0 {
96+
tracing::warn!("Error loading dark theme: {e:?}");
97+
}
98+
e.1
99+
})
100+
})
87101
.unwrap_or_else(Theme::dark_default);
88-
89102
let cosmic_workspaces = match CosmicWorkspaces::new() {
90103
Ok(cosmic_workspaces) => Some(cosmic_workspaces),
91104
Err(err) => {

cosmic-panel-bin/src/xdg_shell_wrapper/shared_state.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ impl GlobalState {
224224
}
225225

226226
pub(crate) fn enable_blur_capacity(&mut self) {
227-
dbg!("blur enabled by compositor");
228227
self.client_state.blur_enabled = true;
229228
for space in &mut self.space.space_list {
230229
space.enable_blur_capacity(

0 commit comments

Comments
 (0)