summaryrefslogtreecommitdiff
path: root/src/mouse.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-24 13:55:12 -0300
committerGabriel Schneider <[email protected]>2026-10-24 16:02:22 -0300
commit4c635f357adb95235429d8905b8598a2643b4f3b (patch)
treedd4f4f9b7e66b2bad71a0d30541c2b4ce2bb4cb9 /src/mouse.zig
parent95321ab082a750f4f1ef26d9bb21d1d3d01274f2 (diff)
downloadpardes-4c635f357adb95235429d8905b8598a2643b4f3b.tar.gz
pardes-4c635f357adb95235429d8905b8598a2643b4f3b.zip
drag 2/3: a pane's or column's grip let go past the window's edge opens it in a new window (Handover.zig)
Diffstat (limited to 'src/mouse.zig')
-rw-r--r--src/mouse.zig15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mouse.zig b/src/mouse.zig
index 3400afbe..d8f19059 100644
--- a/src/mouse.zig
+++ b/src/mouse.zig
@@ -477,6 +477,21 @@ pub fn handleMouse(p: *Pardes, event: Mouse) void {
if (m.kind == .press) p.jumpBy(if (m.button == .back) -1 else 1);
return;
}
+ // A grip let go past the window's edge, as a browser's tab dragged out
+ // of its window: the pane or column goes to another window. Inside, the
+ // grip's drag is the layout move below, as it always was.
+ if (m.kind == .release and m.outside and m.button == config.select_button) switch (p.drag) {
+ .move => |d| {
+ p.drag = .none;
+ return p.handover.begin(p, .pane, d.id);
+ },
+ .column_move => |d| {
+ p.drag = .none;
+ const column = layout.columnBySerial(p, d.serial) orelse return;
+ return p.handover.begin(p, .column, column);
+ },
+ else => {},
+ };
const raw_col = @min(m.col, p.screen_w -| 1);
const raw_row = @min(m.row, p.screen_h -| 1);
p.pointer_raw_col = raw_col;