summaryrefslogtreecommitdiff
path: root/src/ninep/ctl.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 00:41:23 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commit0fe78621cc0db8b835ebcb7c51bbd2d20d6dbcc2 (patch)
tree9e263810f35b82f4d1b667fa601e6b55cdcb0ebc /src/ninep/ctl.zig
parent6732ce6edcf1562d3e126ed02f96466ab07c498e (diff)
downloadpardes-0fe78621cc0db8b835ebcb7c51bbd2d20d6dbcc2.tar.gz
pardes-0fe78621cc0db8b835ebcb7c51bbd2d20d6dbcc2.zip
A focus write makes its pane's column the active one, and layout's active is it
Writing a serial to /focus gave that pane the keyboard but left the active column where it was, so pane/new under Placement acme went elsewhere, and /layout's active named the keyboard's column rather than where a new pane would go. A focus write now sets the active column as the user's click there would, under either Placement, and /layout's active names the active column, which pane/new and a look place into. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/ctl.zig')
-rw-r--r--src/ninep/ctl.zig5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index 325fc8c8..98120555 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -486,9 +486,12 @@ pub fn writeFocus(p: *Pardes, req: Req) Reply {
const text = std.mem.trim(u8, req.data, " \t\r\n");
const serial = std.fmt.parseInt(u32, text, 10) catch return tree.failText(req.tag, E.INVAL, tree.e_bad_ctl);
const id = p.paneBySerial(serial) orelse return tree.failText(req.tag, E.NOENT, e_no_pane);
- // The keyboard goes to the pane itself, off any header that had it.
+ // The keyboard goes to the pane itself, off any header that had it, and
+ // its column becomes the active one, as the user's click there would
+ // make it: pane/new and a look place there next, whatever Placement.
tagline.exitHeader(p);
p.active = id;
+ if (pardes.layout.findPane(p, id)) |at| p.setActiveColumn(at.col);
return .{ .tag = req.tag, .written = @intCast(req.data.len) };
}