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:
@@ -147,6 +147,8 @@ config_t config_defaults(void) {
|
||||
{"n", ACTION_STEP},
|
||||
{"+", ACTION_SPEED_UP},
|
||||
{"-", ACTION_SPEED_DOWN},
|
||||
{"g", ACTION_TOGGLE_GRID},
|
||||
{"c", ACTION_CLEAR},
|
||||
};
|
||||
int ndef = sizeof(defs) / sizeof(defs[0]);
|
||||
for (int i = 0; i < ndef; i++) {
|
||||
@@ -180,7 +182,9 @@ static const char *default_file_content =
|
||||
"\"p\" = \"pause\"\n"
|
||||
"\"n\" = \"step\"\n"
|
||||
"\"+\" = \"speed_up\"\n"
|
||||
"\"-\" = \"speed_down\"\n";
|
||||
"\"-\" = \"speed_down\"\n"
|
||||
"\"g\" = \"toggle_grid\"\n"
|
||||
"\"c\" = \"clear\"\n";
|
||||
|
||||
int config_ensure_default_file(const char *path) {
|
||||
if (!path) return -1;
|
||||
|
||||
Reference in New Issue
Block a user