From 296a212837e111e7391f3f40ec7955caefc62425 Mon Sep 17 00:00:00 2001 From: foxnne Date: Sat, 17 Oct 2026 11:02:52 -0500 Subject: [PATCH] zig: a lifted view keeps its drag through dvui's captureMouseGet The view-drag lift (app/layout/Chooser.zig) and the workbench tab drag (plugins/workbench/src/Workspace.zig) read dvui's internal captures[0] since 0.17's per-pointer capture (dvui#1014), a ZIG017 stand-in that assumed the mouse. dvui.captureMouseGet() is the public call, and is the capture of the pointer that last moved, so a touch drag keeps its own. Co-Authored-By: Claude Opus 5.5 --- app/layout/Chooser.zig | 2 +- plugins/workbench/src/Workspace.zig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/layout/Chooser.zig b/app/layout/Chooser.zig index 741fd1d89..ae6ee0fbb 100644 --- a/app/layout/Chooser.zig +++ b/app/layout/Chooser.zig @@ -303,7 +303,7 @@ fn carryLifted(self: *Chooser) void { } else { f.beginViewDrag(lift.id, lift.rect); // From the motion that lifted it on: a release in the same frame is the drag's too. - if (dvui.currentWindow().captures[0]) |cm| // ZIG017: per-pointer capture (dvui#1014); 0 is the mouse + if (dvui.captureMouseGet()) |cm| dvui.captureMouseCustom(cm, lift.event); } self.carried = lift.id; diff --git a/plugins/workbench/src/Workspace.zig b/plugins/workbench/src/Workspace.zig index 2976d590a..729ff3865 100644 --- a/plugins/workbench/src/Workspace.zig +++ b/plugins/workbench/src/Workspace.zig @@ -532,7 +532,7 @@ fn lift(id: []const u8, from: dvui.Rect.Physical, event_num: u16) void { wb.carried_tab_key = std.hash.Wyhash.hash(0, id); runtime.host().beginViewDrag(id, from); if (runtime.host().viewDragSurface() == null) return; - if (dvui.currentWindow().captures[0]) |cm| // ZIG017: per-pointer capture (dvui#1014); 0 is the mouse + if (dvui.captureMouseGet()) |cm| dvui.captureMouseCustom(cm, event_num); }