fix(input): honor pointer entry position and make clear work
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.
This commit is contained in:
@@ -28,8 +28,12 @@ int main(void) {
|
||||
config_t cfg = config_defaults();
|
||||
xkb_keysym_t one = xkb_keysym_from_name("1", XKB_KEYSYM_CASE_INSENSITIVE);
|
||||
xkb_keysym_t space = xkb_keysym_from_name("space", XKB_KEYSYM_CASE_INSENSITIVE);
|
||||
xkb_keysym_t g = xkb_keysym_from_name("g", XKB_KEYSYM_CASE_INSENSITIVE);
|
||||
xkb_keysym_t c = xkb_keysym_from_name("c", XKB_KEYSYM_CASE_INSENSITIVE);
|
||||
assert(config_lookup(&cfg, 0, one) == ACTION_SELECT_GLIDER);
|
||||
assert(config_lookup(&cfg, 0, space) == ACTION_ROTATE);
|
||||
assert(config_lookup(&cfg, 0, g) == ACTION_TOGGLE_GRID);
|
||||
assert(config_lookup(&cfg, 0, c) == ACTION_CLEAR);
|
||||
|
||||
const char *path = "/tmp/opencode/test_keys.conf";
|
||||
FILE *fp = fopen(path, "w");
|
||||
|
||||
Reference in New Issue
Block a user