atagen

monolith

public
Star0
Watch0

Commit f89d02f177fa

tarball

atagen <boss@atagen.co>2026-10-19 10:39 UTC

2 files changed+8-0
ipc: report each placed window's area in state

The quickshell screenshot picker needs window rects to select a window under the cursor, and State only carried outputs' areas. The rect is the settled placement from Wm's placed, in the same global logical coordinates as Output.area.
Modified file: crates/ipc/src/lib.rs+3 additions
@@ -317,6 +317,9 @@ pub struct Window {
317317 pub title: String,
318318 pub tag: String,
319319 pub output: Option<String>,
320+ /// x, y, width, height in logical pixels, while placed on an output.
321+ #[serde(default)]
322+ pub area: Option<[f64; 4]>,
320323 pub floating: bool,
321324 pub fullscreen: bool,
322325 pub sticky: bool,
Modified file: crates/monolith/src/ipc.rs+5 additions
@@ -193,6 +193,11 @@ fn snapshot(state: &State) -> monolith_ipc::State {
193193 .map(|(_, t)| t.name.clone())
194194 .unwrap_or_default(),
195195 output: w.output.and_then(|o| l.output(o)).map(|o| o.name.clone()),
196+ area: state
197+ .wm
198+ .get(id)
199+ .and_then(|s| s.placed)
200+ .map(|(_, r, _)| [r.x, r.y, r.w, r.h]),
196201 floating: w.floating,
197202 fullscreen: w.fullscreen,
198203 sticky: w.sticky,