Merge drag-out hand-off fix: keep the drag internal while the pointer is over REAPER
This commit is contained in:
@@ -199,6 +199,10 @@ LiveDrop resolveLiveDrop(int x, int y) {
|
||||
const DropProbe probe = probeDropTarget(sp.x, sp.y);
|
||||
ctx.surface = probe.surface;
|
||||
ctx.haveTrack = probe.track != nullptr;
|
||||
// Two probes because they answer two independent questions: what REAPER named, and
|
||||
// whether we are still inside REAPER at all. The law's hand-off gate reads both — see
|
||||
// ui::DropContext::pointerOffHost.
|
||||
ctx.pointerOffHost = !pointerOverHostWindow(sp.x, sp.y);
|
||||
out.track = probe.track;
|
||||
out.screenX = sp.x;
|
||||
}
|
||||
@@ -219,11 +223,12 @@ LiveDrop resolveLiveDrop(int x, int y) {
|
||||
// loop, so the internal drag must be fully wound down first, and only once the payload is known
|
||||
// to be hand-off-able. This runs on every qualifying move — do not memoize a failed attempt.
|
||||
//
|
||||
// Residual (accepted): once the pointer has left REAPER, dragging back INTO a REAPER window
|
||||
// Residual (accepted): once the pointer has genuinely left every REAPER window, dragging back IN
|
||||
// mid-modal-loop delivers a CF_HDROP to REAPER's own file-import drop target rather than to our
|
||||
// gesture law. NOT confirmed by experiment — inferred from REAPER's handling of external file
|
||||
// drops, and the inferred outcome (an item at the drop point) coincides with what our own
|
||||
// arrange path would have done.
|
||||
// arrange path would have done. This is now the ONLY way to see that import ghost mid-drag;
|
||||
// reaching it from a surface still inside REAPER was the defect pointerOffHost closed.
|
||||
void handOffToOs() {
|
||||
// Resolve BEFORE tearing anything down (the resolver reads the live drag payload), then let
|
||||
// the pure rule couple the two side effects: an unresolvable payload leaves the internal
|
||||
@@ -242,6 +247,10 @@ void handOffToOs() {
|
||||
invalidatePanel();
|
||||
|
||||
initiateDragOut(g_panel.hwnd, paths); // COPY-ONLY; blocking on Windows
|
||||
|
||||
// The drag state was reset above, so the WM_LBUTTONUP that ends the modal loop takes
|
||||
// onLBtnUp's not-dragging branch and never restores the arrow — do it here instead.
|
||||
SetCursor(LoadCursor(nullptr, IDC_ARROW));
|
||||
}
|
||||
|
||||
// Resolves the topmost INTERACTIVE element under client (x, y) for hover feedback,
|
||||
|
||||
Reference in New Issue
Block a user