diff --git a/crates/app/src/main.rs b/crates/app/src/main.rs index bd60616..e105257 100644 --- a/crates/app/src/main.rs +++ b/crates/app/src/main.rs @@ -3999,6 +3999,16 @@ impl Player { } } + /// The line taken back down again, by the row that drew it and by no other: + /// the pointer has been carried off `lane`, so the slot it was promising is + /// no longer the one a release would commit to. + fn forget_lane_drop(&mut self, lane: Lane, cx: &mut Context) { + if self.lane_drop.is_some_and(|d| d.lane == lane) { + self.lane_drop = None; + cx.notify(); + } + } + /// The same shadow for a library row: its head at [`Player::place_frame`], /// which is where the drop inserts it, and the file's own length for its /// width -- the length the library row already reports. A file this lane diff --git a/crates/app/src/ui/timeline.rs b/crates/app/src/ui/timeline.rs index 16f5bf3..6689697 100644 --- a/crates/app/src/ui/timeline.rs +++ b/crates/app/src/ui/timeline.rs @@ -822,8 +822,15 @@ impl Player { })) .on_drag_move(cx.listener( move |this, event: &DragMoveEvent, _, cx| { + // Carried off this row, the line it was promising goes with + // it: a cue left painted over a slot a release out here does + // not commit is the drag saying one thing and the drop + // doing another. Its *own* promise only -- gpui runs this on + // every painted row, not just the one under the pointer, so + // a row that cleared the cue outright would rub out the line + // the hovered row had just drawn. if !event.bounds.contains(&event.event.position) { - return; + return this.forget_lane_drop(lane, cx); } this.preview_lane_drop(event.drag(cx).0, lane, cx); },