aboutsummaryrefslogtreecommitdiff
path: root/niri-config/src
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-04-25 10:08:26 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-04-25 02:00:18 -0700
commite6d82d3ee34a7ac225d07ca3f4f4365cf27292d1 (patch)
tree36880baab7b89832ced2f38ab79e8b93b6cac687 /niri-config/src
parentfae3a276418ef1f6f6baad465f160e33a6ac9d8a (diff)
downloadniri-e6d82d3ee34a7ac225d07ca3f4f4365cf27292d1.tar.gz
niri-e6d82d3ee34a7ac225d07ca3f4f4365cf27292d1.tar.bz2
niri-e6d82d3ee34a7ac225d07ca3f4f4365cf27292d1.zip
Implement top-left hot corner to toggle the Overview
Compared to third-party implementations such as waycorner: - It works during interactive window move (no surfaces receive pointer focus in this case, so this cannot work through layer-shell). - It works during drag-and-drop. - It disables itself over fullscreen windows. - It does not prevent direct scanout.
Diffstat (limited to 'niri-config/src')
-rw-r--r--niri-config/src/lib.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/niri-config/src/lib.rs b/niri-config/src/lib.rs
index 9bad320b..3fef17b1 100644
--- a/niri-config/src/lib.rs
+++ b/niri-config/src/lib.rs
@@ -1210,6 +1210,8 @@ pub struct Gestures {
pub dnd_edge_view_scroll: DndEdgeViewScroll,
#[knuffel(child, default)]
pub dnd_edge_workspace_switch: DndEdgeWorkspaceSwitch,
+ #[knuffel(child, default)]
+ pub hot_corners: HotCorners,
}
#[derive(knuffel::Decode, Debug, Clone, Copy, PartialEq)]
@@ -1252,6 +1254,12 @@ impl Default for DndEdgeWorkspaceSwitch {
}
}
+#[derive(knuffel::Decode, Debug, Default, Clone, Copy, PartialEq)]
+pub struct HotCorners {
+ #[knuffel(child)]
+ pub off: bool,
+}
+
#[derive(knuffel::Decode, Debug, Clone, Copy, PartialEq)]
pub struct Overview {
#[knuffel(child, unwrap(argument), default = Self::default().zoom)]
@@ -4587,6 +4595,9 @@ mod tests {
1500.0,
),
},
+ hot_corners: HotCorners {
+ off: false,
+ },
},
overview: Overview {
zoom: FloatOrInt(