srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/crates/core/src/monitor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/core/src/monitor.rs')
-rw-r--r--crates/core/src/monitor.rs20
1 files changed, 18 insertions, 2 deletions
diff --git a/crates/core/src/monitor.rs b/crates/core/src/monitor.rs
index aa25fba..b04ee15 100644
--- a/crates/core/src/monitor.rs
+++ b/crates/core/src/monitor.rs
@@ -5,14 +5,30 @@ pub type MonitorId = u32;
#[derive(Debug, Clone)]
pub struct Monitor {
pub id: MonitorId,
- pub name: String,
+ /// Usable area: the output rect shrunk by any layer-shell exclusive
+ /// zone (a bar/dock). What placement, tiling and maximize target --
+ /// see `full_geometry`'s doc comment for the one thing that
+ /// deliberately does *not* use this field.
pub geometry: Rect,
+ /// The output's true full rect, ignoring any exclusive zone.
+ ///
+ /// Kept separate from `geometry` because "respects the dock" and
+ /// "doesn't" are two genuinely different behaviors a window needs,
+ /// not one setting: fullscreen (and a window being interactively
+ /// dragged) should be able to cover or cross the strip a bar/dock
+ /// reserves - the bar just renders on top, as an overlay, the same
+ /// way it does everywhere else - while a *new* window's placement,
+ /// tiling and maximize should keep avoiding that strip, same as
+ /// before. Defaults to `geometry` (no reservation) for any backend
+ /// that hasn't been taught the distinction yet.
+ pub full_geometry: Rect,
+ pub name: String,
pub refresh_rate_mhz: u32,
pub primary: bool,
}
impl Monitor {
pub fn new(id: MonitorId, name: impl Into<String>, geometry: Rect) -> Self {
- Self { id, name: name.into(), geometry, refresh_rate_mhz: 60_000, primary: false }
+ Self { id, name: name.into(), geometry, full_geometry: geometry, refresh_rate_mhz: 60_000, primary: false }
}
}