summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--src/config.rs2
-rw-r--r--src/state.rs8
3 files changed, 8 insertions, 4 deletions
diff --git a/README.md b/README.md
index 7560e49..dc59235 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@ A list of things that are missing (for now):
- Click events lack some info (IDK if anyone actually relies on `x`, `y`, `width`, etc.)
- Tray icons
-## Advantages
+## Features
- `river` support (obviously)
- `short_text` switching is "progressive" (see https://github.com/i3/i3/issues/4113)
diff --git a/src/config.rs b/src/config.rs
index 33cb4f7..a65269f 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -103,7 +103,7 @@ impl Config {
}
}
-#[derive(Deserialize, Debug, Clone, Copy)]
+#[derive(Deserialize, Debug, Clone, Copy, PartialEq, Eq)]
#[serde(rename_all = "lowercase")]
pub enum Position {
Top,
diff --git a/src/state.rs b/src/state.rs
index 5884580..b4123d3 100644
--- a/src/state.rs
+++ b/src/state.rs
@@ -1,3 +1,4 @@
+use crate::config::Position;
use crate::cursor::CursorTheme;
use crate::protocol::*;
use crate::wm_info_provider::*;
@@ -178,8 +179,11 @@ impl State {
layer_surface.set_exclusive_zone(
conn,
(self.shared_state.config.height) as i32
- + self.shared_state.config.margin_top
- + self.shared_state.config.margin_bottom,
+ + if config.position == Position::Top {
+ self.shared_state.config.margin_bottom
+ } else {
+ self.shared_state.config.margin_top
+ },
);
// Note: layer_surface is commited when we receive the scale factor of this output