summaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-24 11:57:11 -0300
committerGabriel Schneider <[email protected]>2026-11-24 12:23:08 -0300
commitfe8d39e583cd19458727aa1caf01af3cc15abda6 (patch)
treeebff014f044007013f6671c1222c14e32cbde822 /dev
parent9124da2051f72dec9ed301af19d62b5ff17b20d8 (diff)
downloadpardes-fe8d39e583cd19458727aa1caf01af3cc15abda6.tar.gz
pardes-fe8d39e583cd19458727aa1caf01af3cc15abda6.zip
test/daemon.py --client-motion over three roads (FAILING on main), and the test feed's `mouse;pointer;<button>;<x>;<y>` (the motion `motion` builds, pushed onto SDL's queue as a mouse's comes, for the window's wait to take): the hunt's row wrote its 300 motions through the feed's own dispatch, which no real pointer takes; now 300 motions a road, each asserted at most 20 (30 bytes a motion, the feed reads 1024 bytes a pass: at most ten passes, each one input, and the five inputs a client makes anyway): over a window client of a terminal's session by the feed (`motion`) and by SDL's queue (`pointer`), the inputs it sent (PARDES_REPLICA_STATS), and a drag over a window's own session with a terminal client watching, the frames the window drew (its test status); on this tree (Debug, both ends) 305 and 305 inputs, and 95 frames (the session's `split` holds each motion after a wait's first for the next wait: a wait, a pump, a unit and a frame a cell the pointer crosses)
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'dev')
-rw-r--r--dev/gui/gui.zig12
1 files changed, 10 insertions, 2 deletions
diff --git a/dev/gui/gui.zig b/dev/gui/gui.zig
index 2756f69b..2e5dc5c2 100644
--- a/dev/gui/gui.zig
+++ b/dev/gui/gui.zig
@@ -1530,6 +1530,9 @@ const StdinFeed = struct {
// window pixels, built as SDL would and run through dispatch,
// so a driver exercises the real pointer path (pixel to cell,
// tag and body hits). SGR mouse carries only cells.
+ // mouse;pointer;<SDL button, 0 for none>;<x>;<y>: a motion as
+ // `motion` builds it, pushed onto SDL's queue as a mouse's
+ // comes, for the window's wait to take with the rest.
// finger;<kind>;<id>;<x>;<y>;<pressure>
// close: the window's close button
// One the read cut short, or what may yet begin one, waits for
@@ -1558,7 +1561,7 @@ const StdinFeed = struct {
// counts them: shift 4, meta (alt) 8, ctrl 16.
const held = std.fmt.parseInt(u8, parts.next() orelse "0", 10) catch 0;
var sev = std.mem.zeroes(c.SDL_Event);
- const k = std.meta.stringToEnum(enum { wheel, focus, motion, down, up }, kind) orelse .up;
+ const k = std.meta.stringToEnum(enum { wheel, focus, motion, pointer, down, up }, kind) orelse .up;
switch (k) {
.wheel => {
// ESC]777;mouse;wheel;<y, SDL's sign: up positive>;<x>;<y>BEL:
@@ -1572,7 +1575,7 @@ const StdinFeed = struct {
},
// ESC]777;mouse;focus;<1 gained, 0 lost>;0;0BEL
.focus => sev.type = if (button != 0) c.SDL_EVENT_WINDOW_FOCUS_GAINED else c.SDL_EVENT_WINDOW_FOCUS_LOST,
- .motion => {
+ .motion, .pointer => {
sev.type = c.SDL_EVENT_MOUSE_MOTION;
sev.motion.x = x;
sev.motion.y = y;
@@ -1586,6 +1589,11 @@ const StdinFeed = struct {
sev.button.y = y;
},
}
+ if (k == .pointer) {
+ sev.motion.windowID = c.SDL_GetWindowID(gp.window);
+ _ = c.SDL_PushEvent(&sev);
+ continue;
+ }
const before = c.SDL_GetModState();
var mods: c.SDL_Keymod = 0;
if (held & 4 != 0) mods |= c.SDL_KMOD_LSHIFT;