mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
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>
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user