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.2 KiB
2.2 KiB
Tasks
1. Input fixes
- 1.1 Set
pd->x/pd->yinpointer_enter_handlerfromwl_fixed_to_double(sx/sy)intpointer.c; verify by running the app and confirming the pattern preview renders at the entry cell when the pointer enters without further motion - 1.2 Add
pointer_set_motion_handler()totpointer.c/tpointer.hmirroring the button-handler pattern, register it inwlgol.cto store logical cursor position, and stop readingpointer_data.x/yinloop_update(); verify withcmake --build ./buildandctest --test-dir buildplus a run checking that painting still follows the cursor
2. Actions and default bindings
- 2.1 Implement
ACTION_CLEARinwlgol.casgrid_clear(&grid)+screen_dirty = 1; verify by pressing the clear binding with cells on the grid and observing them disappear - 2.2 Add
"g" = "toggle_grid"and"c" = "clear"todefault_file_contentinconfig.cand to the built-in defaults; verify withctest --test-dir build(config tests) and a run pressing both keys on a fresh default config - 2.3 Extend
tests/test_config.cto assert lookup of the new default bindings (g-> ACTION_TOGGLE_GRID,c-> ACTION_CLEAR) and verify withctest --test-dir build
3. Buffer lifecycle on resize
- 3.1 In
canvas_resize, park the outgoingwl_buffer/wl_shm_poolincanvas.old_buffer/old_poolinstead of destroying them immediately (munmap of old data stays immediate), and destroy them fromwl_buffer_release_handler; verify by resizing the window repeatedly at fractional scale and confirming no artifacts or crashes (WAYLAND_DEBUG=1shows no destroy-before-release)
4. Cleanup (behavior-neutral)
- 4.1 Remove
show_linesfromgrid_tand its uses, keeping theshow_grid_linesflag; verify withctest --test-dir buildand the grid-line toggle key - 4.2 Free
grid,grid_back,grid_renderedafter the main loop exits; verify with valgrind (or a leak-checker run of a short session) reporting no leaks from those buffers - 4.3 Remove the dead
ok ? 220 : 220ternary and checkftruncate's return value incanvas_resize; verify withcmake --build ./buildproducing no new warnings