d20f4d5481
Pointer enter ignored the surface position, so the pattern preview rendered at a stale cell until the first motion event. The clear action only printed a message and toggle_grid had no default key binding, leaving both unreachable without a hand-written config. Set the cursor position from the enter event, implement clear via grid_clear plus a dirty flag, and add g/c default bindings in both the built-in table and the generated config template. Also defer wl_buffer destruction on resize until the compositor releases it, route pointer motion through a handler hook instead of reading pointer_data directly, and clean up dead code (show_lines, unused ternary, unchecked ftruncate, unfreed grid buffers). Fixes a wl_callback proxy leak from frame-callback overwrite. Syncs the keyboard-bindings and display-scaling specs and archives the fix-review-findings change.
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.