summaryrefslogtreecommitdiff
path: root/src/mouse.zig
diff options
context:
space:
mode:
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;