atagen

monolith

public
Star0
Watch0

Commit 29e5c25cd383

tarball

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

3 files changed+10-1
input: keep the resize cursor off while a drag and drop runs

The hover edges were recomputed on every motion, so a drag and drop passing over a floating window's ring replaced the drag cursor with a resize arrow.
Modified file: crates/monolith/src/input.rs+4 additions−1 deletions
@@ -75,7 +75,10 @@ impl State {
7575 None => (None, None),
7676 };
7777 let before = pointer.current_focus().and_then(|s| s.client());
78- let hover = self.edge_at(pos, cover).map(|(_, e)| e);
78+ let hover = self
79+ .edge_at(pos, cover)
80+ .filter(|_| !self.input.dnd)
81+ .map(|(_, e)| e);
7982 if std::mem::replace(&mut self.input.hover, hover) != hover {
8083 self.dirty.cursor = true;
8184 }
Modified file: crates/monolith/src/seat.rs+4 additions
@@ -135,6 +135,7 @@ impl State {
135135 }
136136
137137 fn end_dnd(&mut self) {
138+ self.input.dnd = false;
138139 self.input.dnd_icon = None;
139140 self.dirty.redraw = true;
140141 }
@@ -174,6 +175,9 @@ impl WaylandDndGrabHandler for State {
174175 return self.end_dnd();
175176 };
176177 let grab = DnDGrab::new_pointer(&dh, start_data, source, seat.clone());
178+ self.input.dnd = true;
179+ self.input.hover = None;
180+ self.dirty.cursor = true;
177181 if let Some(pointer) = seat.get_pointer() {
178182 pointer.set_grab(self, grab, serial, Focus::Keep);
179183 }
Modified file: crates/monolith/src/state.rs+2 additions
@@ -63,6 +63,7 @@ pub struct Input {
6363 pub cursor: crate::cursor::Cursor,
6464 pub cursor_status: CursorImageStatus,
6565 pub dnd_icon: Option<crate::cursor::DndIcon>,
66+ pub dnd: bool,
6667 /// The edges of the window border under the pointer, for the resize cursor.
6768 pub hover: Option<crate::input::Edges>,
6869 /// The output the pointer was last on, whose scale cursor and drag icon surfaces follow.
@@ -209,6 +210,7 @@ impl State {
209210 cursor: crate::cursor::Cursor::load(),
210211 cursor_status: CursorImageStatus::default_named(),
211212 dnd_icon: None,
213+ dnd: false,
212214 hover: None,
213215 pointer_output: None,
214216 absolute: None,