aboutsummaryrefslogtreecommitdiff
path: root/niri-config
diff options
context:
space:
mode:
authorKai Koehler <45439844+Fireye04@users.noreply.github.com>2025-09-16 08:10:01 -0700
committerGitHub <noreply@github.com>2025-09-16 15:10:01 +0000
commit08f5c6fecb3c5c81d63a0bf7248c85ae3299a4a5 (patch)
tree4fec3ec4899a723f153ffa2d7e790bd0ead14996 /niri-config
parentbffc5c137757b0b006391fa0e9fe996d3d044abd (diff)
downloadniri-08f5c6fecb3c5c81d63a0bf7248c85ae3299a4a5.tar.gz
niri-08f5c6fecb3c5c81d63a0bf7248c85ae3299a4a5.tar.bz2
niri-08f5c6fecb3c5c81d63a0bf7248c85ae3299a4a5.zip
Make hot corners configurable, including per-output (#2108)
* Add corner selection in config * Add hot corner docs * Working per-monitor hot corners Handle defaults * run cargo fmt --all * Fix hot corners in is_sticky_obscured_under * Change default to fall back to gesture hot corners if output hot corners are unset * Add hot corner output config docs * Support fractional scaling * Trigger hot corners over widgets * Improve float handling Fixed YaLTeR/niri/pull/2108 * Refactor * Bug Fixes * Amend docs Fix styling Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com> * Integrate code review Move is_inside_hot_corner * fixes --------- Co-authored-by: Aadniz <8147434+Aadniz@users.noreply.github.com> Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com>
Diffstat (limited to 'niri-config')
-rw-r--r--niri-config/src/gestures.rs8
-rw-r--r--niri-config/src/lib.rs20
-rw-r--r--niri-config/src/output.rs4
3 files changed, 32 insertions, 0 deletions
diff --git a/niri-config/src/gestures.rs b/niri-config/src/gestures.rs
index 893cc053..8c4b1363 100644
--- a/niri-config/src/gestures.rs
+++ b/niri-config/src/gestures.rs
@@ -54,4 +54,12 @@ impl Default for DndEdgeWorkspaceSwitch {
pub struct HotCorners {
#[knuffel(child)]
pub off: bool,
+ #[knuffel(child)]
+ pub top_left: bool,
+ #[knuffel(child)]
+ pub top_right: bool,
+ #[knuffel(child)]
+ pub bottom_left: bool,
+ #[knuffel(child)]
+ pub bottom_right: bool,
}
diff --git a/niri-config/src/lib.rs b/niri-config/src/lib.rs
index 8e07839e..e795b46e 100644
--- a/niri-config/src/lib.rs
+++ b/niri-config/src/lib.rs
@@ -348,6 +348,13 @@ mod tests {
mode "1920x1080@144"
variable-refresh-rate on-demand=true
background-color "rgba(25, 25, 102, 1.0)"
+ hot-corners {
+ off
+ top-left
+ top-right
+ bottom-left
+ bottom-right
+ }
}
layout {
@@ -742,6 +749,15 @@ mod tests {
},
),
backdrop_color: None,
+ hot_corners: Some(
+ HotCorners {
+ off: true,
+ top_left: true,
+ top_right: true,
+ bottom_left: true,
+ bottom_right: true,
+ },
+ ),
},
],
),
@@ -1158,6 +1174,10 @@ mod tests {
},
hot_corners: HotCorners {
off: false,
+ top_left: false,
+ top_right: false,
+ bottom_left: false,
+ bottom_right: false,
},
},
overview: Overview {
diff --git a/niri-config/src/output.rs b/niri-config/src/output.rs
index 9b12aa7b..b0e1d26c 100644
--- a/niri-config/src/output.rs
+++ b/niri-config/src/output.rs
@@ -1,5 +1,6 @@
use niri_ipc::{ConfiguredMode, Transform};
+use crate::gestures::HotCorners;
use crate::{Color, FloatOrInt};
#[derive(Debug, Default, Clone, PartialEq)]
@@ -27,6 +28,8 @@ pub struct Output {
pub background_color: Option<Color>,
#[knuffel(child)]
pub backdrop_color: Option<Color>,
+ #[knuffel(child)]
+ pub hot_corners: Option<HotCorners>,
}
impl Output {
@@ -56,6 +59,7 @@ impl Default for Output {
variable_refresh_rate: None,
background_color: None,
backdrop_color: None,
+ hot_corners: None,
}
}
}