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.
This commit is contained in:
Ivan Molodetskikh
2025-04-25 10:08:26 +03:00
parent fae3a27641
commit e6d82d3ee3
3 changed files with 64 additions and 1 deletions
+11
View File
@@ -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(