From 4c635f357adb95235429d8905b8598a2643b4f3b Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sat, 24 Oct 2026 13:55:12 -0300 Subject: 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) --- src/mouse.zig | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/mouse.zig') 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; -- cgit v1.3