diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-19 09:35:48 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-19 11:40:11 -0300 |
| commit | 40c9f9ac0b6bf46ed8f1be162cf3c2b58d3e2513 (patch) | |
| tree | f0266ccf08c6033b880ef9dd19330b260c2d34d9 /dev/gui | |
| parent | 3f0261245d69e015d4caea0432aefa97747d02ad (diff) | |
| download | pardes-40c9f9ac0b6bf46ed8f1be162cf3c2b58d3e2513.tar.gz pardes-40c9f9ac0b6bf46ed8f1be162cf3c2b58d3e2513.zip | |
client: a client's yank, paste and link are its own frontend's, through the client loop (the reorganisation's runners, step 10b, its third part; the user's ruling: a client's yank fills the CLIENT's clipboard, always): since 12a the session's host no longer makes them for a view a client draws, and its view counts each request (View.yanks, pastes, links and the link), so until now a far client's yank, paste and link did nothing on either machine; after each settle the loop compares the view's three counts with those it has acted on (Link.yanks, pastes and links, from the joined dump's at each join, so a join does none again; only a count that moved forward, so a rollback that puts one back and makes it again is not a second) and its frontend acts on the machine it is shown on: copy (register `+`: the terminal's OSC 52 through vaxis, the window's SDL clipboard), paste (the terminal asks its clipboard and the answer comes back as a paste through the loop's input, the window sends the clipboard's text as a paste at once), open (look.openLink); three more frontend calls, the soak's frontend counting them (y/p/l in its stops line) and answering a paste with one; the soak types ClipYank and ClipPaste now and then; a test through the loop over a frontend that draws nothing (runtime/client.zig: a client's ClipYank, ClipPaste and Look of a URL each reach its frontend once, at once and not again when the session's unit confirms it, the link as typed, and the session's host is asked none of them). Gate: tui core-test 837/980 (143 skipped: the base's and the new test), shell-test 1015/1018, term-test 15/15, pane-test 183/184, kitty-test 45/45, behaviour-test 275/275 and --replay 275/275, process-test 2 of 144 failed (lspcomplete and lspcompletemoved, the base's; headersweep, winch and lsp-client failed once and passed again in the run); gui unit-test 1613/1617 with the base's BaselineHarnessMismatch; the soak (--clients 5) diverged 0, unequal 0, deltas wrong 0, quiet checks 526/0, 550/0, 811/0, unlisted 0, the clients' frontends did 3 yanks and 9 pastes (2/3, 0/3, 1/3), stopped 41/72/71 of 1846/1727/2015, mispredicted 29/40/39 at rtt 30/80/207 (its random inputs changed: ClipYank and ClipPaste among them); daemon.py plain, --far, --games, --window-clients, --upgrade from pardes-tree's pfx-base to this and back; the macOS library for Linux and aarch64-macos and the FreeBSD tui configure; rollback-bench runs; gate-w run3-3 against tree1 PASS: frames 77/77 byte-identical in Debug, unit-test 1613/1617 (no failure the base has not), the alternated windows' pictures identical in all 10 runs, corpus2x -0.105%, perfops 97 counts within 0.1% (largest image-frame on longline +0.026%)
Co-Authored-By: Claude Opus <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'dev/gui')
| -rw-r--r-- | dev/gui/gui.zig | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/dev/gui/gui.zig b/dev/gui/gui.zig index 66b7328d..909c83c6 100644 --- a/dev/gui/gui.zig +++ b/dev/gui/gui.zig @@ -1422,6 +1422,23 @@ const Client = struct { return .{ .drew = cl.shell.presented, .moving = frontendMoving(cl.g) }; } + /// What its view asked of this machine (client.zig `asks`): register + /// `+` to the desktop's clipboard, the clipboard's text sent as a paste, + /// a link opened. + pub fn copy(cl: *Client, text: []const u8) void { + putClipboard(cl.gpa, text); + } + + pub fn paste(_: *Client, l: *ClientLoop) void { + const text = takeClipboard() orelse return; + defer c.SDL_free(text.ptr); + l.input(.{ .paste = text }); + } + + pub fn open(_: *Client, url: []const u8) void { + look.openLink(url); + } + /// The reader's: a message of the stream, for the loop, which it wakes. pub fn said(cl: *Client, msg: replica.Said) bool { cl.lock.lockUncancelable(cl.io); |
