srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/crates/core/src/monitor.rs
diff options
context:
space:
mode:
authorsrdusr <[email protected]>2024-11-26 23:16:00 +0200
committersrdusr <[email protected]>2024-11-26 23:16:00 +0200
commit87f5c04b2593dc49409644e69e7962b73d26b9d8 (patch)
tree5a1da319c9f5e81489af44a4a576eada595b9a22 /crates/core/src/monitor.rs
parentfe92f6e6b8ab680c9603cc6bcf16c98555c378ae (diff)
downloadsrdwm-87f5c04b2593dc49409644e69e7962b73d26b9d8.tar.gz
srdwm-87f5c04b2593dc49409644e69e7962b73d26b9d8.zip
Add Monitor::maximize_geometry: maximize covers a dock, still stops at a top bar
toggle_maximize previously targeted full_geometry outright (past every reserved zone), on an earlier request specifically about the dock - which also silently let it extend behind a top bar's zone, reported back as its own bug once live-tested. maximize_geometry is a third rect distinct from geometry (every zone) and full_geometry (none): full_geometry with only a top-anchored bar's exclusive zone subtracted back out. New test locks in dock-covered/bar-respected together.
Diffstat (limited to 'crates/core/src/monitor.rs')
-rw-r--r--crates/core/src/monitor.rs19
1 files changed, 18 insertions, 1 deletions
diff --git a/crates/core/src/monitor.rs b/crates/core/src/monitor.rs
index b04ee15..01f54cb 100644
--- a/crates/core/src/monitor.rs
+++ b/crates/core/src/monitor.rs
@@ -22,6 +22,23 @@ pub struct Monitor {
/// before. Defaults to `geometry` (no reservation) for any backend
/// that hasn't been taught the distinction yet.
pub full_geometry: Rect,
+ /// The rect `toggle_maximize` targets: `full_geometry` with only a
+ /// top-anchored bar's exclusive zone (a menu bar, always expected to
+ /// stay visible/reachable) subtracted back out again - a dock anchored
+ /// to any other edge is deliberately left alone, same as
+ /// `full_geometry`. Two behaviors maximize needs that neither
+ /// `geometry` (shrunk by *every* zone) nor `full_geometry` (shrunk by
+ /// none) can express on its own: "go past the dock" and "still stop at
+ /// the top bar" are both true at once, on the user's own explicit
+ /// call when the two pulled in opposite directions (`full_geometry` had
+ /// briefly covered both, which un-did "stop at the top bar" as a side
+ /// effect of fixing "go past the dock").
+ ///
+ /// Defaults to `geometry` (no reservation ignored at all) for any
+ /// backend or test that hasn't been taught the per-edge distinction --
+ /// same conservative-default reasoning as `full_geometry`'s own doc
+ /// comment.
+ pub maximize_geometry: Rect,
pub name: String,
pub refresh_rate_mhz: u32,
pub primary: bool,
@@ -29,6 +46,6 @@ pub struct Monitor {
impl Monitor {
pub fn new(id: MonitorId, name: impl Into<String>, geometry: Rect) -> Self {
- Self { id, name: name.into(), geometry, full_geometry: geometry, refresh_rate_mhz: 60_000, primary: false }
+ Self { id, name: name.into(), geometry, full_geometry: geometry, maximize_geometry: geometry, refresh_rate_mhz: 60_000, primary: false }
}
}