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.
18 lines
421 B
C
18 lines
421 B
C
#ifndef GRID_H
|
|
#define GRID_H
|
|
|
|
typedef struct {
|
|
int cols;
|
|
int rows;
|
|
unsigned char *cells;
|
|
} grid_t;
|
|
|
|
void grid_init(grid_t *g, int cols, int rows);
|
|
void grid_free(grid_t *g);
|
|
void grid_resize(grid_t *g, int new_cols, int new_rows);
|
|
void grid_clear(grid_t *g);
|
|
void grid_copy(grid_t *dst, const grid_t *src);
|
|
int grid_get(const grid_t *g, int c, int r);
|
|
void grid_set(grid_t *g, int c, int r, int val);
|
|
|
|
#endif |