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:
@@ -0,0 +1,14 @@
|
||||
# Spec Delta: fix-review-findings
|
||||
|
||||
## MODIFIED Requirements
|
||||
|
||||
### Requirement: Input coordinates remain logical
|
||||
The system SHALL report mouse positions and grid cells in logical coordinates regardless of the active scale.
|
||||
|
||||
#### Scenario: Scaled click
|
||||
- **WHEN** the user clicks on a scaled display
|
||||
- **THEN** the selected grid cell matches the visual location of the cursor
|
||||
|
||||
#### Scenario: Pointer entry without motion
|
||||
- **WHEN** the pointer enters the canvas surface at a position and no motion event follows
|
||||
- **THEN** the reported cursor position matches the entry point in logical coordinates
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
# Spec Delta: fix-review-findings
|
||||
|
||||
## MODIFIED Requirements
|
||||
|
||||
### Requirement: Default bindings are available without configuration
|
||||
The system SHALL provide built-in default bindings for every supported action — digits 1-0 selecting the ten built-in patterns, Space rotating, Escape cancelling, Ctrl+Q quitting, P pausing, N stepping, +/- changing simulation speed, G toggling grid lines, and C clearing the grid.
|
||||
|
||||
#### Scenario: No config file present
|
||||
- **WHEN** the application starts and `~/.config/wlgol/keys.conf` does not exist
|
||||
- **THEN** the application uses the built-in default bindings
|
||||
- **AND** creates the config file with the default contents
|
||||
|
||||
#### Scenario: Clear without configuration
|
||||
- **WHEN** the default bindings are active and the user presses C
|
||||
- **THEN** the clear action is triggered
|
||||
|
||||
#### Scenario: Toggle grid lines without configuration
|
||||
- **WHEN** the default bindings are active and the user presses G
|
||||
- **THEN** the toggle_grid action is triggered
|
||||
Reference in New Issue
Block a user