diff options
Diffstat (limited to 'crates/core/src/monitor.rs')
| -rw-r--r-- | crates/core/src/monitor.rs | 19 |
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 } } } |