Skip to content

fix(text_input): deduplicate cursor blink timer and stop when inactive (backport) - #1103

Open
dst0 wants to merge 1 commit into
lapce:lapce-backportsfrom
dst0:backport/text-input-blink-timer
Open

dst0 wants to merge 1 commit into
lapce:lapce-backportsfrom
dst0:backport/text-input-blink-timer

Conversation

@dst0

@dst0 dst0 commented Dec 2, 2026

Copy link
Copy Markdown

Backports cursor blink timer deduplication to lapce-backports.

Summary

  • Extract blink timing state into CursorBlink (src/views/text_input_blink.rs) so at most one blink timer can be pending at a time and inactive/hidden/selected inputs stop scheduling periodic repaints.
  • Reset the blink timer phase on focus gain and handled input events, and drive ticks through ViewId::update_state(CursorBlinkTick).
  • Add 4 unit tests covering blink interval transitions, timer deduplication, input resets, and stopping when inactive.

Verification

  • rustfmt --check src/views/text_input_blink.rs src/views/text_input.rs passed.
  • cargo check --lib and cargo test --lib passed (63 passed, 0 failed, including 4 views::text_input_blink::tests::*).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant