Skip to content

Commit

Permalink
Log names of unknown buttons in layout config (PolyMeilex#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
proski authored Aug 22, 2023
1 parent f619323 commit 0999ee8
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/buttons.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use log::warn;
use log::{debug, warn};
use tiny_skia::{FillRule, PathBuilder, PixmapMut, Rect, Stroke, Transform};

use smithay_client_toolkit::shell::xdg::window::{WindowManagerCapabilities, WindowState};
Expand Down Expand Up @@ -161,17 +161,20 @@ impl Buttons {

for button in config.split(',').take(3) {
let button_kind = match button {
"close" => Some(ButtonKind::Close),
"maximize" => Some(ButtonKind::Maximize),
"minimize" => Some(ButtonKind::Minimize),
_ => None,
"close" => ButtonKind::Close,
"maximize" => ButtonKind::Maximize,
"minimize" => ButtonKind::Minimize,
"appmenu" => {
debug!("Ignoring \"appmenu\" button");
continue;
}
_ => {
warn!("Ignoring unknown button type: {button}");
continue;
}
};

let Some(kind) = button_kind else {
warn!("Found unknown button type, ignoring");
continue;
};
buttons.push(Button::new(kind));
buttons.push(Button::new(button_kind));
}

// For the right side, we need to revert the order
Expand Down

0 comments on commit 0999ee8

Please sign in to comment.