diff --git a/src/config/window_definition.rs b/src/config/window_definition.rs index 00ac348..2dccd1e 100644 --- a/src/config/window_definition.rs +++ b/src/config/window_definition.rs @@ -113,11 +113,6 @@ pub enum Side { Left, Right, Bottom, - Center, - TopLeft, - TopRight, - BottomLeft, - BottomRight, } impl std::str::FromStr for Side { @@ -133,25 +128,6 @@ impl std::str::FromStr for Side { _ => Err(anyhow!("Failed to parse {} as valid side. Must be one of \"left\", \"right\", \"top\", \"bottom\"", s)), } } - - #[cfg(feature = "wayland")] - fn from_str(s: &str) -> Result { - match s { - "l" | "left" => Ok(Side::Left), - "r" | "right" => Ok(Side::Right), - "t" | "top" => Ok(Side::Top), - "b" | "bottom" => Ok(Side::Bottom), - "c" | "center" => Ok(Side::Center), - "tl" | "top-left" => Ok(Side::TopLeft), - "tr" | "top-right" => Ok(Side::TopRight), - "bl" | "bottom-left" => Ok(Side::BottomLeft), - "br" | "bottom-right" => Ok(Side::BottomRight), - _ => Err(anyhow!( - r#"Failed to parse {} as valid side. Must be one of "left", "right", "top", "bottom", "top-right", "top-left", "bottom-left", "bottom-right""#, - s - )), - } - } } // Surface definition if the backend for X11 is enable diff --git a/src/display_backend.rs b/src/display_backend.rs index bd44391..35a11e7 100644 --- a/src/display_backend.rs +++ b/src/display_backend.rs @@ -162,7 +162,6 @@ mod platform { let dist = match strut_def.side { Side::Left | Side::Right => strut_def.dist.relative_to(monitor_rect.width) as u32, Side::Top | Side::Bottom => strut_def.dist.relative_to(monitor_rect.height) as u32, - _ => (monitor_rect.height / 2) as u32, }; // don't question it,..... @@ -176,7 +175,6 @@ mod platform { Side::Bottom => vec![0, 0, 0, root_window_geometry.height as u32 - mon_end_y + dist, 0, 0, 0, 0, 0, 0, monitor_rect.x as u32, mon_end_x], // This should never happen but if it does the window will be anchored on the // right of the screen - _ => vec![0, root_window_geometry.width as u32 - mon_end_x + dist, 0, 0, 0, 0, monitor_rect.y as u32, mon_end_y, 0, 0, 0, 0], }.iter().flat_map(|x| x.to_le_bytes().to_vec()).collect(); self.conn