atagen

monolith

public
Star0
Watch0

Commit 59722c006437

tarball

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

2 files changed+1-3
monolith: map space elements at their rect origin

Space::map_element takes the window geometry origin and subtracts geometry().loc itself when it computes render_location, so mapping at rect minus geometry().loc doubled the offset. Input for windows with a nonzero geometry offset, like GTK with shadow margins, landed that offset up and left of where scene.rs drew them.
Modified file: crates/monolith/src/state.rs−1 deletions
@@ -380,7 +380,6 @@ impl State {
380380 && (free || configure(&window, rect, kind, self.wm.layout.maximized(id)))
381381 {
382382 let loc = (rect.x.round() as i32, rect.y.round() as i32);
383- let loc = Point::from(loc) - window.geometry().loc;
384383 self.wm.space.map_element(window, loc, false);
385384 mapped.push(id);
386385 }
Modified file: crates/monolith/src/windows.rs+1 additions−2 deletions
@@ -474,8 +474,7 @@ impl State {
474474 let Some(mapped) = self.wm.space.element_location(window) else {
475475 return;
476476 };
477- let at =
478- Point::from((rect.x.round() as i32, rect.y.round() as i32)) - window.geometry().loc;
477+ let at = Point::from((rect.x.round() as i32, rect.y.round() as i32));
479478 if at != mapped {
480479 let window = window.clone();
481480 self.wm.space.relocate_element(&window, at);