Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input handling refactor #3366

Merged
merged 6 commits into from
Mar 27, 2024
Merged

Input handling refactor #3366

merged 6 commits into from
Mar 27, 2024

Conversation

jmercouris
Copy link
Member

@jmercouris jmercouris commented Mar 25, 2024

Description

Handle input PER buffer, not PER window.

Checklist:

  • Git branch state is mergable.
  • Changelog is up to date (via a separate commit).
  • New dependencies are accounted for.
  • Documentation is up to date.
  • Compilation and tests ((asdf:test-system :nyxt/<renderer>))
    • No new compilation warnings.
    • Tests are sufficient.

@jmercouris jmercouris requested a review from aadcg March 25, 2024 17:03
@jmercouris jmercouris force-pushed the input-handling-refactor branch 4 times, most recently from ca748a4 to 68b545c Compare March 26, 2024 05:18
@aadcg
Copy link
Member

aadcg commented Mar 27, 2024

Will review by tomorrow at the latest.

It is now done per buffer, instead of per window.

Opens possibilities for further simplifying input handling such as having multiple
buffers per window or binding keybindings on panel buffers.

Disconnect handlers when hiding a buffer on the WebKitGTK port.

Prevents the prompt buffer from having unnecessary handlers bound to it as it
disappears and appears.

Move command-dispatcher slot from window to browser class.

Move key-stack and last-key slots from window to buffer class.

Delete input-skip-dispatcher slot.
These are problems that GTK should solve, not us. Additionally GTK does not work
well on macOS, particularly WebKitGTK+.

See NixOS/nixpkgs#126101.
Copy link
Member

@aadcg aadcg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A very solid step into a much saner implementation. One chunk less of technical debt. Thanks @jmercouris.

The PR introduces a problem on the Electron port but I'll open an issue mentioning it. See #3371.

Merging with minor commit message and changelog edits.

@@ -27,6 +27,9 @@

(define-version "4.0.0"
(:ul
(:li "Refactor input to be handled on the buffer level rather than the window
level. This will allow panel buffers to have their own hotkeys. It will also
allow for vertical and horizontal splitting of buffers.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog isn't the right place for political campaign, right? 😄

@aadcg aadcg force-pushed the input-handling-refactor branch from 68b545c to 51004e0 Compare March 27, 2024 16:07
@aadcg aadcg merged commit bb19c9e into master Mar 27, 2024
3 checks passed
@aadcg aadcg deleted the input-handling-refactor branch March 27, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants