34f3f514cb
Capture the code review findings as an OpenSpec change: pointer enter position, working clear action with default g/c bindings, release-deferred buffer destruction on resize, and behavior-neutral cleanups. Includes design decisions and implementation tasks.
2.1 KiB
2.1 KiB
Proposal
Why
A code review of the renderer/input path found two functional defects (pattern preview lands at a wrong cell when the pointer enters without motion; the clear action does nothing and toggle_grid is unreachable with default bindings) plus implementation-only cleanup that reduces duplicated state and protocol sloppiness in the canvas resize path.
What Changes
- Set the cursor position from the pointer
enterevent (surface-local, logical), so the pattern preview renders at the true entry cell instead of the last stale position. - Implement the
clearaction: set all cells dead and mark the screen dirty (thecell-gridspec already requires this; the code only printed a message). - Add missing default key bindings:
"g" = toggle_grid,"c" = clear(assumption: these keys; adjust in review). - Destroy the SHM buffer on resize only after its release event, or otherwise make
canvas_resizenot destroy a buffer the compositor may still be reading. - Cleanup, no behavior change: drop the redundant
grid.show_linesfield (keep the singleshow_grid_linesflag), pass pointer position to the main loop through the existing handler pattern instead of readingpointer_datadirectly, free the three grid buffers on exit, remove the dead preview color ternary, checkftruncate's return value.
Capabilities
New Capabilities
Modified Capabilities
keyboard-bindings: the default-bindings requirement now explicitly covers every supported action, including clear and toggle_grid, with the new default keys.display-scaling: the input-coordinates requirement gains a scenario — the cursor position is correct at pointer entry, not only after motion events.
Impact
wlgol.c: ACTION_CLEAR handler, canvas_resize buffer lifecycle, exit cleanup, preview colors.tpointer.c: pointer enter handler setsx/yfromsx/sy.config.c: two added entries in the default keymap file content.include/grid.h/grid.c: removal ofshow_linesfield (call sites inwlgol.cupdated).- No new dependencies; no protocol changes.