atagen

monolith

public
Star0
Watch0

Commit a0f6535dbb5c

tarball

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

2 files changed+6-0
windows: end a drag or resize hold when its window closes

remove_window left Input::drag and Wm::resizing pointing at a dead WindowId until the button came up, holding the layout in its stretched resize state meanwhile.
Modified file: crates/monolith/src/input.rs+5 additions
@@ -611,6 +611,11 @@ fn window_rect(layout: &Layout, id: WindowId) -> Option<Rect> {
611611 }
612612
613613 impl State {
614+ pub fn forget_drag(&mut self, id: WindowId) {
615+ self.input.drag.take_if(|d| d.window == id);
616+ self.wm.resizing.take_if(|r| r.window == id);
617+ }
618+
614619 /// Starts moving, or with `edges` resizing, a floating window at a
615620 /// client's request. Tiled windows are left alone.
616621 pub fn client_drag(&mut self, id: WindowId, edges: Option<Edges>, button: u32) {
Modified file: crates/monolith/src/windows.rs+1 additions
@@ -346,6 +346,7 @@ impl State {
346346 }
347347
348348 pub fn remove_window(&mut self, id: WindowId) -> Option<Window> {
349+ self.forget_drag(id);
349350 let state = self.wm.remove(id);
350351 if let Some(state) = &state {
351352 self.wm.space.unmap_elem(&state.window);